diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..8c139c7bec --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: +- package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/doc/locale/es/LC_MESSAGES/docs.po b/doc/locale/es/LC_MESSAGES/docs.po index b0d837eb2f..bd287ee7b3 100644 --- a/doc/locale/es/LC_MESSAGES/docs.po +++ b/doc/locale/es/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-22 11:19+0000\n" +"PO-Revision-Date: 2022-09-01 08:03+0000\n" "Last-Translator: Asdrubal Lozada-Blanco \n" "Language-Team: Spanish \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.14-dev\n" +"X-Generator: Weblate 4.14.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 @@ -755,10 +755,14 @@ msgid "" " initial values for data objects in named _common blocks_, but we do not " "recommend the use of _common blocks_ (use modules instead)." msgstr "" +"Nota: También puede ser una unidad de programa de _bloques de datos_, que se " +"utiliza para proporcionar valores iniciales para objetos de datos en " +"_bloques comunes_ con nombre, pero no recomendamos el uso de _bloques " +"comunes_ (utilice módulos en su lugar)." #: ../../doc/src/design.md:124 msgid "LFortran Extension" -msgstr "" +msgstr "Extensión LFortran" #: ../../doc/src/design.md:126 msgid "" @@ -767,22 +771,26 @@ msgid "" "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" +"Extendemos el lenguaje Fortran introduciendo un _alcance global_, que no es " +"sola la lista de _unidades de programa_ (como en F2800) sino que puede " +"también incluir declaraciones, expresiones y declaraciones de uso. Definimos " +"_alcance global_ como una colección de los elementos siguientes:" #: ../../doc/src/design.md:134 msgid "use statement" -msgstr "" +msgstr "declaración de uso" #: ../../doc/src/design.md:135 msgid "declaration" -msgstr "" +msgstr "declaración" #: ../../doc/src/design.md:136 msgid "statement" -msgstr "" +msgstr "declaración" #: ../../doc/src/design.md:137 msgid "expression" -msgstr "" +msgstr "expresión" #: ../../doc/src/design.md:139 msgid "" @@ -793,6 +801,13 @@ msgid "" "at the top level of _global scope_. Types must be fully specified inside " "main programs, modules, functions and subroutines, just like in F2008." msgstr "" +"Además, si una variable no está definida en una instrucción de asignación (" +"como `x = 5+3`), el tipo de variable se deduce del lado derecho (por " +"ejemplo, `x` en `x = 5+3`). ` sería de tipo `integer`, y `y` en `y = 5._dp` " +"sería de tipo `real(dp)`). Esta regla solo se aplica en el nivel superior de " +"_alcance global_. Los tipos deben especificarse completamente dentro de los " +"programas, módulos, funciones y subrutinas principales, al igual que en " +"F2008." #: ../../doc/src/design.md:146 msgid "" @@ -801,24 +816,34 @@ msgid "" "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" +"El _alcance global_ tiene su propia tabla de símbolos. El programa principal " +"y el módulo/submódulo no ven ningún símbolo de esta tabla de símbolos. Pero " +"las funciones, subrutinas, declaraciones y expresiones en el nivel superior " +"del _alcance global_ usan y operan en esta tabla de símbolos." #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" msgstr "" +"El _alcance global_ tiene los siguientes símbolos predefinidos en la tabla " +"de símbolos:" #: ../../doc/src/design.md:153 msgid "" "the usual standard set of Fortran functions (such as `size`, `sin`, " "`cos`, ...)" msgstr "" +"el conjunto estándar habitual de funciones de Fortran (como `size`, `sin`, " +"`cos`, ...)" #: ../../doc/src/design.md:155 msgid "" "the `dp` double precision symbol, so that one can use `5._dp` for double " "precision." msgstr "" +"el símbolo de doble precisión `dp`, por lo que se puede usar `5._dp` para " +"doble precisión." #: ../../doc/src/design.md:158 msgid "" @@ -832,6 +857,15 @@ msgid "" "arguments returning the expression, compiled, loaded, executed and the " "return value is returned to the user." msgstr "" +"Cada elemento del _alcance global_ se interpreta de la siguiente manera: el " +"programa principal se compila en un ejecutable con el mismo nombre y se " +"ejecuta; se compilan y cargan módulos, funciones y subrutinas; use sentencia " +"y declaración agrega esos símbolos con el tipo adecuado en la tabla de " +"símbolos _alcance global_, pero no genera ningún código; la declaración se " +"envuelve en una subrutina anónima sin argumentos, se compila, se carga y se " +"ejecuta; expresión se envuelve en una función anónima sin argumentos que " +"devuelven la expresión, compilada, cargada, ejecutada y el valor de retorno " +"se devuelve al usuario." #: ../../doc/src/design.md:168 msgid "" @@ -843,30 +877,37 @@ msgid "" "subroutines or functions and by adding type declarations) and compile it " "with `lfortran` or any other Fortran compiler." msgstr "" +"El _alcance global_ siempre se interpreta, elemento por elemento, según el " +"párrafo anterior. Está destinado a permitir el uso interactivo, la " +"experimentación y la escritura de scripts simples. El código en _alcance " +"global_ debe interpretarse usando `lfortran`. Para código más complejo (de " +"producción), se recomienda convertirlo en módulos y programas (envolviendo " +"sentencias sueltas en subrutinas o funciones y agregando declaraciones de " +"tipo) y compilarlo con `lfortran` o cualquier otro compilador de Fortran." #: ../../doc/src/design.md:176 msgid "Here are some examples of valid code in _global scope_:" -msgstr "" +msgstr "Aquí algunos ejemplos de código válidos en _alcance global_:" #: ../../doc/src/design.md:178 msgid "Example 1" -msgstr "" +msgstr "Ejemplo 1" #: ../../doc/src/design.md:185 msgid "Example 2" -msgstr "" +msgstr "Ejemplo 2" #: ../../doc/src/design.md:197 msgid "Example 3" -msgstr "" +msgstr "Ejemplo 3" #: ../../doc/src/design.md:209 msgid "Example 4" -msgstr "" +msgstr "Ejemplo 4" #: ../../doc/src/design.md:217 msgid "Design Considerations" -msgstr "" +msgstr "Consideraciones de diseño" #: ../../doc/src/design.md:219 msgid "" @@ -877,6 +918,12 @@ msgid "" "inside functions, subroutines, modules or programs this relaxation does " "not apply." msgstr "" +"La extensión LFortran de Fortran se eligió de manera que se minimice el " +"número de cambios. En particular, solo el nivel superior del _alcance " +"global_ ha relajado algunas de las reglas de Fortran (como hacer que la " +"especificación de tipos sea opcional) para permitir un uso interactivo " +"simple y rápido, pero dentro de las funciones, subrutinas, módulos o " +"programas, esta relajación no se aplica." #: ../../doc/src/design.md:225 msgid "" @@ -885,20 +932,26 @@ msgid "" "Fortran code using programs and modules, so that it can be compiled by " "any Fortran compiler." msgstr "" +"El número de cambios se mantuvo al mínimo para que sea sencillo convertir el " +"código en _alcance global_ en código Fortran compatible con el estándar " +"utilizando programas y módulos, de modo que pueda ser compilado por " +"cualquier compilador de Fortran." #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" -msgstr "" +msgstr "Tutorial para desarrolladores" #: ../../doc/src/developer_tutorial.ipynb:11 msgid "" "This is a tutorial for anybody who wants to either develop LFortran or " "build tools on top." msgstr "" +"Este es un tutorial para cualquiera que quiera desarrollar LFortran o " +"construir herramientas sobre este." #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" -msgstr "" +msgstr "Introducción" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" @@ -906,6 +959,9 @@ msgid "" "based on syntax, no semantic is included. The AST module can convert " "itself to Fortran source code." msgstr "" +"Árbol de sintaxis abstracta (AST): Representa cualquier código fuente " +"Fortran, basado estrictamente en la sintaxis, la semántica no está incluida. " +"El módulo AST puede convertirse en código fuente de Fortran." #: ../../doc/src/developer_tutorial.ipynb:20 msgid "" @@ -913,59 +969,69 @@ msgid "" " 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." msgstr "" +"Representación de semántica abstracta (ASR): Representa un código fuente " +"Fortran válido, toda la semántica está incluida. Código Fortran inválido no " +"es permitido (un error será emitido). El módulo ASR puede convertirse en un " +"AST." #: ../../doc/src/developer_tutorial.ipynb:25 msgid "" "Fortran source code can be parsed into an AST using the ``src_to_ast()`` " "function:" msgstr "" +"Código fuente Fortran puede ser analizado en un AST usando la función " +"``src_to_ast()``:" #: ../../doc/src/developer_tutorial.ipynb:49 #, python-format msgid "We can pretty print it using the ``%%showast`` magic:" -msgstr "" +msgstr "Podemos imprimir usando el truco ``%%showast``:" #: ../../doc/src/developer_tutorial.ipynb:98 #, python-format msgid "We can convert AST to Fortran source code using ``%%showfmt``:" -msgstr "" +msgstr "Podemos convertir un AST a código fuente Fortran usando ``%%showfmt``:" #: ../../doc/src/developer_tutorial.ipynb:156 msgid "" "All AST nodes and their arguments are described in `AST.asdl " "`__." msgstr "" +"Todos los nodos AST y sus argumentos están descritos en `AST.asdl " +"`__." #: ../../doc/src/developer_tutorial.ipynb:170 #, python-format msgid "We can pretty print using the ``%%showasr`` magic:" -msgstr "" +msgstr "Podemos imprimir usando el truco ``%%showasr``:" #: ../../doc/src/developer_tutorial.ipynb:219 msgid "" "All ASR nodes and their arguments are described in `ASR.asdl " "`__." msgstr "" +"Todos los nodos ASR y sus argumentos están descritos en `ASR.asdl " +"`__." #: ../../doc/src/index.md:134 msgid "Getting started" -msgstr "" +msgstr "Iniciando" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" -msgstr "" +msgstr "Estado del desarrollo de LFortran" #: ../../doc/src/index.md:147 msgid "Developer's Guide" -msgstr "" +msgstr "Guía del desarrollador" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" -msgstr "" +msgstr "Intrínsecos de LFortran" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" -msgstr "" +msgstr "Documentación de LFortran" #: ../../doc/src/index.md:3 msgid "" @@ -975,6 +1041,12 @@ msgid "" "compile to binaries with the goal to run user's code on modern " "architectures such as multi-core CPUs and GPUs." msgstr "" +"LFortran es un moderno compilador interactivo de Fortran de código abierto (" +"bajo la licencia BSD) construido sobre LLVM. Este puede ejecutar código de " +"usuario interactivamente para permitir trabajo exploratório (similar a " +"Python, MATLAB o Julia) , así como compilar para generar archivos binarios " +"con el objetivo de ejecutar el código de usuario en arquitecturas modernas, " +"como CPU y GPU de varios núcleos." #: ../../doc/src/index.md:9 #, python-format @@ -986,6 +1058,11 @@ msgid "" "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" +"Página web: [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)" #: ../../doc/src/index.md:9 msgid "Binder" @@ -993,7 +1070,7 @@ msgstr "" #: ../../doc/src/index.md:16 msgid "Feature Highlights" -msgstr "" +msgstr "Características destacadas" #: ../../doc/src/index.md:18 msgid "" @@ -1002,10 +1079,14 @@ msgid "" "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" +"LFortran está en desarrollo, hay características que funcionan actualmente y " +"hay características que se están implementando. También puede consultar la " +"sección [Estado de desarrollo](progress.md) para obtener más información " +"sobre las funciones compatibles y en las que se está trabajando." #: ../../doc/src/index.md:21 msgid "Works today" -msgstr "" +msgstr "Trabajando actualmente" #: ../../doc/src/index.md:23 #, python-format @@ -1018,6 +1099,14 @@ msgid "" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" +"**Interactivo, compatible con Jupyter** LFortran se puede usar desde Jupyter " +"como un kernel de Fortran, lo que permite un flujo de trabajo exploratorio y " +"de creación rápida de prototipos al estilo de Python/Julia (ver " +"[static](https://nbviewer.jupyter.org/gist/certik " +"/f1d28a486510810d824869ab0c491b1c) o [interactivo](https://mybinder.org/v2/" +"gl/lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb) cuaderno de " +"ejemplo). O se puede usar desde la línea de comandos en un indicador " +"interactivo (REPL)." #: ../../doc/src/index.md:32 msgid "" @@ -1028,6 +1117,13 @@ msgid "" "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" +"**Diseño limpio y modular, utilizable como biblioteca** LFortran está " +"estructurado en torno a dos módulos independientes, AST y ASR, ambos " +"independientes (completamente independientes del resto de LFortran) y se " +"recomienda a los usuarios que los utilicen de forma independiente para otras " +"aplicaciones y construir herramientas en la parte superior. Consulte los " +"documentos [Diseño](design.md) y [Tutorial para " +"desarrolladores](developer_tutorial.md) para obtener más detalles." #: ../../doc/src/index.md:39 msgid "" @@ -1036,28 +1132,38 @@ msgid "" "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" +"**Interoperación con GFortran** LFortran puede analizar los archivos del " +"módulo GFortran en una ASR y generar un contenedor Fortran que se puede " +"compilar con cualquier compilador Fortran y vincular con el módulo compilado " +"GFortran original." #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." msgstr "" +"**Crear ejecutables** Puede crear ejecutables como otros compiladores de " +"Fortran." #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." msgstr "" +"**Se ejecuta en Linux, Mac y Windows** Las tres plataformas son probadas " +"regularmente por nuestro CI." #: ../../doc/src/index.md:51 msgid "Planned" -msgstr "" +msgstr "Planificación" #: ../../doc/src/index.md:53 msgid "" "These features are under development, there is a link to the " "corresponding issue so that you can track the progress by following it." msgstr "" +"Estas características están en desarrollo, hay un enlace al problema " +"correspondiente para que pueda seguir el avance." #: ../../doc/src/index.md:56 msgid "" @@ -1070,6 +1176,15 @@ msgid "" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" +"**Interoperación nativa con otros lenguajes (y otros compiladores de " +"Fortran)** Esta puede puede llamar automáticamente código escrito en otros " +"lenguajes (tales como C o Python) simplemente usando la instrucción `use`, " +"ver [#44](https://gitlab.com/lfortran/lfortran/issues/44). Comprende otros " +"archivos de módulos de compiladores de Fortran (uno puede simplemente " +"\"usarlos\") y su ABI para enlazar correctamente (se admite GFortran, se " +"planean otros compiladores, consulte [# 56](https://gitlab.com/lfortran/" +"lfortran/ issues/56)), que permite utilizar LFortran con códigos de " +"producción en la actualidad." #: ../../doc/src/index.md:65 msgid "" @@ -1078,6 +1193,11 @@ msgid "" "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" +"**Compatibilidad con hardware moderno** Gracias a LLVM, el objetivo de " +"LFortran es ejecutarse en hardware moderno y aprovechar las construcciones " +"nativas del lenguaje Fortran (como `do concurrent`) para ejecutarse en CPU y " +"GPU multinúcleo, consulte [# 57](https://gitlab.com/lfortran/lfortran/issues/" +"57)." #: ../../doc/src/index.md:71 msgid "" @@ -1086,6 +1206,10 @@ msgid "" "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" +"**Compatibilidad completa con Fortran 2018** Actualmente solo se implementa " +"un subconjunto de Fortran, pero el objetivo es tener una implementación " +"completa del último estándar de Fortran 2018, consulte [#58](https://gitlab." +"com/lfortran/lfortran /temas/58)." #: ../../doc/src/index.md:77 msgid "" @@ -1093,14 +1217,19 @@ msgid "" "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" +"Vote sobre los problemas en nuestro [seguidor de problemas](https://gitlab." +"com/lfortran/lfortran/issues) que desea que prioricemos (no dude en crear " +"nuevos si nos falta algo)." #: ../../doc/src/index.md:81 msgid "Roadmap" -msgstr "" +msgstr "Guía" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" msgstr "" +"Aquí está nuestra guía sobre cómo implementar todas las funciones " +"planificadas anteriormente:" #: ../../doc/src/index.md:85 msgid "" @@ -1109,6 +1238,10 @@ msgid "" "code generation and old semantics, that used to annotate the AST tree, " "which was messy." msgstr "" +"Generación de código de puerto para usar una ASR y pasar todas las pruebas " +"actuales ([#74](https://gitlab.com/lfortran/lfortran/issues/74)). Elimine la " +"generación de código anterior y la semántica anterior, que solía anotar el " +"árbol AST, que estaba desordenado." #: ../../doc/src/index.md:89 msgid "" @@ -1117,16 +1250,23 @@ msgid "" "([#52](https://gitlab.com/lfortran/lfortran/issues/52)). This will allow " "right away to use production codes with LFortran." msgstr "" +"Obtenga los archivos del módulo GFortran que funcionan con el módulo `use`, " +"tanto matrices de tamaño supuesto como de forma supuesta " +"([#52](https://gitlab.com/lfortran/lfortran/issues/52)). Esto permitirá de " +"inmediato utilizar códigos de producción con LFortran." #: ../../doc/src/index.md:93 msgid "Do these at the same time:" -msgstr "" +msgstr "Hacer esto al mismo tiempo:" #: ../../doc/src/index.md:95 msgid "" "a) Implement more Fortran features, until eventually full Fortran 2018 is" " supported ([#58](https://gitlab.com/lfortran/lfortran/issues/58))." msgstr "" +"a) Implementar más funciones de Fortran, hasta que finalmente se admita " +"Fortran 2018 completo ([#58](https://gitlab.com/lfortran/lfortran/issues/" +"58))." #: ../../doc/src/index.md:98 msgid "" @@ -1135,6 +1275,10 @@ msgid "" "will not change (or only minimally), so the user experience from Python " "will not change." msgstr "" +"b) Muévase gradualmente a C++ para obtener robustez y velocidad " +"([#70](https://gitlab.com/lfortran/lfortran/issues/70)). La API de Python no " +"cambiará (o solo mínimamente), por lo que la experiencia del usuario de " +"Python no cambiará." #: ../../doc/src/index.md:103 msgid "" @@ -1150,10 +1294,20 @@ msgid "" "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" +"c) Implemente todas las demás funciones interesantes: módulo `use` para C y " +"Python y envoltorios automáticos ([#44](https://gitlab.com/lfortran/lfortran/" +"issues/44)), soporte de hardware moderno ([# 57](https://gitlab.com/lfortran/" +"lfortran/issues/57)), generando un estándar anterior de Fortran " +"([#72](https://gitlab.com/lfortran/lfortran/issues/72)) , función de prueba " +"de documentos de Fortran ([#73](https://gitlab.com/lfortran/lfortran/issues/" +"73)), integración de SymPy ([#71](https://gitlab.com/lfortran/lfortran/" +"issues/ 71)), servicio de lenguaje para IDE ([#12](https://gitlab.com/" +"lfortran/lfortran/issues/12)), y otras ideas ([#29](https://gitlab.com/" +"lfortran /lfortran/issues/29))." #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." -msgstr "" +msgstr "El paso 1. es una restauración interna que no llevará mucho tiempo." #: ../../doc/src/index.md:120 msgid "" @@ -1168,6 +1322,17 @@ msgid "" " the given feature. We expect to be finished with the step 2. by the end " "of summer 2019, hopefully sooner." msgstr "" +"El paso 2 permitirá que LFortran se use de forma interactiva con los códigos " +"de producción de inmediato (el código de producción se compilará con " +"GFortran, luego uno \"usa\" cualquier módulo en LFortran y las funciones/" +"subrutinas se pueden llamar de forma interactiva, el módulo en sí puede usar " +"cualquier Función compatible con GFortran, pero la API debe encajar en el " +"subconjunto que comprende LFortran --- para una gran cantidad de " +"aplicaciones, las funciones/subrutinas simples con argumentos de matriz son " +"suficientes). Esto hará que LFortran sea utilizable para los primeros " +"usuarios y siempre se puede usar GFortran temporalmente hasta que LFortran " +"admita la función dada. Esperamos terminar con el paso 2 a fines del verano " +"de 2019, con suerte antes." #: ../../doc/src/index.md:130 msgid "" @@ -1175,18 +1340,22 @@ msgid "" "users to contribute back, growing the community and making LFortran " "gradually useful for more and more people." msgstr "" +"Finalmente, el paso 3 mejorará LFortran en general, permitiendo que los " +"primeros usuarios contribuyan, haciendo crecer la comunidad y haciendo que " +"LFortran sea gradualmente útil para más y más personas." #: ../../doc/src/installation.md:1 msgid "Installation" -msgstr "" +msgstr "Instalación" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." msgstr "" +"Todas las instruciones a continuación funcionan en Linux, macOS y Windows." #: ../../doc/src/installation.md:5 msgid "Binaries" -msgstr "" +msgstr "Binarios" #: ../../doc/src/installation.md:7 msgid "" @@ -1197,10 +1366,15 @@ msgid "" "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" +"La forma recomendada de instalar LFortran es usando Conda. Instale Conda, " +"por ejemplo, instalando la instalación de [Miniconda](https://conda.io/en/" +"latest/miniconda.html) siguiendo las instrucciones allí para su plataforma. " +"Luego cree un nuevo entorno (puede elegir cualquier nombre, aquí elegimos " +"`lf`) y actívelo:" #: ../../doc/src/installation.md:16 msgid "Then install LFortran by:" -msgstr "" +msgstr "Luego instale LFortran haciendo:" #: ../../doc/src/installation.md:20 msgid "" @@ -1208,24 +1382,29 @@ msgid "" "start the interactive prompt by executing `lfortran`, or see the command " "line options using `lfortran -h`." msgstr "" +"Ahora que el entorno `lf` tiene disponible el compilador `lfortran`, puede " +"iniciar el aviso interactivo ejecutando `lfortran`, o ver las opciones de la " +"línea de comando usando `lfortran -h`." #: ../../doc/src/installation.md:24 msgid "" "The Jupyter kernel is automatically installed by the above command, so " "after installing Jupyter itself:" msgstr "" +"El núcleo Jupyter es automáticamente instalado con el comando anterior, por " +"lo que después de instalar Jupyter:" #: ../../doc/src/installation.md:28 msgid "You can create a Fortran based Jupyter notebook by executing:" -msgstr "" +msgstr "Puede crear un cuaderno Jupyter basado en Fortran ejecutando:" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." -msgstr "" +msgstr "y seleccionando `New->Fortran`." #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" -msgstr "" +msgstr "Construir desde una fuente de archivo tar" #: ../../doc/src/installation.md:37 msgid "" @@ -1234,72 +1413,86 @@ msgid "" "etc.). The source tarball has all the generated files included and has " "minimal dependencies." msgstr "" +"Este método es el método recomendado si solo desea instalar LFortran, ya sea " +"usted mismo o en un administrador de paquetes (Spack, Conda, Debian, etc.). " +"La fuente de archivo tar tiene todos los archivos generados incluidos y " +"tiene dependencias mínimas." #: ../../doc/src/installation.md:39 msgid "First we have to install dependencies, for example using Conda:" -msgstr "" +msgstr "Primero tenemos que instalar dependencias, por ejemplo usando Conda:" #: ../../doc/src/installation.md:44 msgid "" "Then download a tarball from " "[https://lfortran.org/download/](https://lfortran.org/download/), e.g.:" msgstr "" +"Luego descargue un archivo tar de [https://lfortran.org/download/" +"](https://lfortran.org/download/), por ejemplo:" #: ../../doc/src/installation.md:52 msgid "And build:" -msgstr "" +msgstr "Y construir:" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." -msgstr "" +msgstr "Esto instalará `lfortran` en `inst/bin`." #: ../../doc/src/installation.md:60 msgid "Build From Git" -msgstr "" +msgstr "Construir desde Git" #: ../../doc/src/installation.md:62 msgid "" "We assume you have C++ compilers installed, as well as `git` and `wget`. " "In Ubuntu, you can also install `binutils-dev` for stacktraces." msgstr "" +"Suponemos que tiene instalados compiladores de C++, así como `git` y `wget`. " +"En Ubuntu, también puede instalar `binutils-dev` para stacktraces." #: ../../doc/src/installation.md:65 msgid "" "If you do not have Conda installed, you can do so on Linux (and similarly" " on other platforms):" msgstr "" +"Si no tiene Conda instalado, puede hacerlo en Linux (y de manera similar en " +"otras plataformas):" #: ../../doc/src/installation.md:72 msgid "Then prepare the environment:" -msgstr "" +msgstr "Luego prepara el ambiente:" #: ../../doc/src/installation.md:77 msgid "Clone the LFortran git repository:" -msgstr "" +msgstr "Clone el repositorio git de LFortran:" #: ../../doc/src/installation.md:82 msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" msgstr "" +"Genere los archivos necesarios para la compilación (este paso depende de " +"`re2c`, `bison` y `python`):" #: ../../doc/src/installation.md:86 msgid "" "Now the process is the same as installing from the source tarball. For " "example to build in Debug mode:" msgstr "" +"Ahora el proceso es el mismo que el de la instalación desde el tarball de " +"origen. Por ejemplo, para compilar en modo de depuración:" #: ../../doc/src/installation.md:92 msgid "Run tests:" -msgstr "" +msgstr "Ejecutar pruebas:" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" -msgstr "" +msgstr "Ejecute un aviso interactivo:" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" -msgstr "" +msgstr "Cree desde Git en Windows con Visual Studio" #: ../../doc/src/installation.md:104 msgid "" @@ -1307,40 +1500,45 @@ msgid "" "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" +"Instale Visual Studio (MSVC), por ejemplo la versión 2022, puede descargar " +"la versión Community de forma gratuita desde: https://visualstudio.microsoft." +"com/downloads/." #: ../../doc/src/installation.md:107 msgid "" "Install miniforge using the Windows installer from https://github.com" "/conda-forge/miniforge." msgstr "" +"Instale miniforge usando el instalador de Windows desde https://github.com/" +"conda-forge/miniforge." #: ../../doc/src/installation.md:109 msgid "Launch the Miniforge Prompt from the Desktop." -msgstr "" +msgstr "Inicie el indicador de Miniforge desde el escritorio." #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" -msgstr "" +msgstr "En la interfaz, inicialice el compilador MSVC usando:" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" -msgstr "" +msgstr "Opcionalmente, puede probar que MSVC funciona:" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." -msgstr "" +msgstr "Ambos comandos deben imprimir ayuda (varias páginas)." #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" -msgstr "" +msgstr "Ahora puede descargar y compilar LFortran:" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" -msgstr "" +msgstr "Si todo está compilado, puede usar LFortran de la siguiente manera:" #: ../../doc/src/installation.md:140 msgid "And so on." -msgstr "" +msgstr "Y así." #: ../../doc/src/installation.md:142 msgid "" @@ -1348,6 +1546,9 @@ msgid "" "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" +"Nota: LFortran actualmente usa el programa enlazador de MSVC (`link`), que " +"solo está disponible cuando se ejecuta el script bat de MSVC anterior. Si " +"olvida activarlo, la vinculación de LFortran fallará." #: ../../doc/src/installation.md:146 msgid "" @@ -1357,10 +1558,15 @@ msgid "" "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" +"Nota: la terminal de miniforge parece estar ejecutando alguna versión de " +"`git-bash` (aunque es `cmd.exe`), que tiene un sistema de archivos tipo Unix " +"montado en `/usr` y varios comandos disponibles como `ls` , `cuál`, `git`, " +"`vim`. Por esta razón, la compilación de Conda `environment_win.yml` " +"contiene todo lo necesario, incluido `git`." #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" -msgstr "" +msgstr "Construya desde Git en Windows con WSL" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." @@ -1368,105 +1574,115 @@ msgstr "" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." -msgstr "" +msgstr "Marque el subsistema de Windows para Linux." #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." -msgstr "" +msgstr "Presione Aceptar y reinicie la computadora." #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." -msgstr "" +msgstr "Vaya a la tienda de Microsoft, descargue Ubuntu 20.04 y ejecútelo." #: ../../doc/src/installation.md:157 msgid "Run the following commands." -msgstr "" +msgstr "Ejecute los siguientes comandos." #: ../../doc/src/installation.md:164 msgid "Now do the following to configure the path" -msgstr "" +msgstr "Ahora haga lo siguiente para configurar la ruta" #: ../../doc/src/installation.md:168 msgid "Then go to the bottom of the file and paste the following" -msgstr "" +msgstr "Luego ve al final del archivo y pega lo siguiente" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" -msgstr "" +msgstr "Luego presione ctrl + O (guardar), Enter (confirmar), ctrl + X (salir)" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" -msgstr "" +msgstr "Después de eso, reinicie Ubuntu" #: ../../doc/src/installation.md:174 msgid "Run the following" -msgstr "" +msgstr "Ejecute lo siguiente" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" -msgstr "" +msgstr "Reinicie Ubuntu de nuevo" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." msgstr "" +"Puede cambiar el directorio a una ubicación de Windows usando `cd /mnt/[" +"letra de unidad]/[ubicación de Windows]`." #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" -msgstr "" +msgstr "p.ej. `cd mnt/c/Users/name/source/repos/`" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" -msgstr "" +msgstr "Ahora clone el repositorio LFortran git" #: ../../doc/src/installation.md:196 msgid "Run the following commands" -msgstr "" +msgstr "Ejecute los siguientes comandos" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" -msgstr "" +msgstr "Si todo se compila, puede usar LFortran de la siguiente manera" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" -msgstr "" +msgstr "Ejecutar un aviso interactivo" #: ../../doc/src/installation.md:215 msgid "Run tests" -msgstr "" +msgstr "Ejecutar pruebas" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" -msgstr "" +msgstr "Habilitación del núcleo de Jupyter" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" msgstr "" +"Para instalar el kernel de Jupyter, instale también los siguientes paquetes " +"de Conda:" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" msgstr "" +"y habilite el núcleo con `-DWITH_XEUS=yes` e instálelo en `$CONDA_PREFIX`. " +"Por ejemplo:" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" msgstr "" +"Para usarlo, instale Jupyter (`conda install jupyter`) y pruebe que se " +"encontró el núcleo de LFortran:" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" -msgstr "" +msgstr "Luego inicie un cuaderno Jupyter de la siguiente manera:" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" msgstr "" +"Haga clic en `New->Fortran`. Para iniciar una consola terminal jupyter " +"LFortran:" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" -msgstr "" +msgstr "Construir desde Git con Nix" #: ../../doc/src/installation.md:256 msgid "" @@ -1475,6 +1691,10 @@ msgid "" "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" +"Una de las formas de garantizar el entorno y las dependencias exactos es con " +"`nix`. Esto garantizará que las dependencias del sistema no interfieran con " +"el entorno de desarrollo. Si lo desea, puede informar de errores en un " +"entorno `nix-shell` para que sea más fácil para otros reproducirlos." #: ../../doc/src/installation.md:258 msgid "With Root" @@ -1486,6 +1706,9 @@ msgid "" "work on any machine with a Linux distribution, MacOS or Windows (via " "WSL):" msgstr "" +"Empezamos por obtener `nix`. La siguiente instalación multiusuario " +"funcionará en cualquier máquina con una distribución de Linux, MacOS o " +"Windows (a través de WSL):" #: ../../doc/src/installation.md:264 msgid "Without Root" @@ -1497,40 +1720,49 @@ msgid "" "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" +"Si no desea proporcionar a `nix` acceso raíz a su máquina, en las " +"distribuciones de Linux podemos usar [nix-portable](https://github.com/" +"DavHau/nix-portable)." #: ../../doc/src/installation.md:270 msgid "" "Now just prepend all `nix-shell` commands with `NP_RUNTIME=bwrap ./nix-" "portable `. So:" msgstr "" +"Ahora solo anteponga todos los comandos `nix-shell` con `NP_RUNTIME=bwrap " +"./nix-portable`. Asi que:" #: ../../doc/src/installation.md:278 msgid "Development" -msgstr "" +msgstr "Desarrollo" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" -msgstr "" +msgstr "Ahora podemos entrar en el entorno de desarrollo:" #: ../../doc/src/installation.md:284 msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." msgstr "" +"El indicador `--pure` garantiza que no se utilicen dependencias del sistema " +"en el entorno." #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" -msgstr "" +msgstr "Los pasos de compilación son los mismos que con el `ci`:" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" msgstr "" +"Para cambiar el entorno de compilación de `gcc` (predeterminado) a `clang` " +"podemos usar `--argstr`:" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" -msgstr "" +msgstr "Nota sobre las dependencias" #: ../../doc/src/installation.md:299 msgid "" @@ -1538,6 +1770,9 @@ msgid "" "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" +"Se alienta a los usuarios finales (y las distribuciones) a usar el archivo " +"tar de [https://lfortran.org/download/](https://lfortran.org/download/), que " +"solo depende de LLVM, CMake y un compilador de C++." #: ../../doc/src/installation.md:303 msgid "" @@ -1545,34 +1780,42 @@ msgid "" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" +"El archivo tar es generado automáticamente por nuestro CI (integración " +"continua) y contiene algunos archivos generados automáticamente: el " +"analizador, los nodos AST y ASR, que es generado por un traductor ASDL (" +"requiere Python)." #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." -msgstr "" +msgstr "Las instrucciones de git deben usarse al desarrollar LFortran en sí." #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" -msgstr "" +msgstr "Nota para usuarios que no utilizan Conda" #: ../../doc/src/installation.md:311 msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," msgstr "" +"Las siguientes son las dependencias necesarias para instalar este " +"repositorio en modo de desarrollo," #: ../../doc/src/installation.md:314 msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" -msgstr "" +msgstr "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" #: ../../doc/src/installation.md:315 msgid "" "[LLVM - 11.0.1](https://github.com/llvm/llvm-" "project/releases/download/llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" msgstr "" +"[LLVM - 11.0.1](https://github.com/llvm/llvm-project/releases/download/" +"llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" #: ../../doc/src/installation.md:316 msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" -msgstr "" +msgstr "[re2c - 2.0.3](https://re2c.org/install/install.html)" #: ../../doc/src/installation.md:317 msgid "" @@ -1581,6 +1824,10 @@ msgid "" " - Make sure that you should enable the required options related to this " "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" +"[binutils - 2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2." +"31.90.tar.xz): asegúrese de habilitar las opciones necesarias relacionadas " +"con esta dependencia para crear la dinámica bibliotecas (las que terminan en " +"`.so`)." #: ../../doc/src/installation.md:319 msgid "Stacktraces" @@ -1596,18 +1843,25 @@ msgid "" "option after installing the prerequisites on each platform per the " "instructions below." msgstr "" +"LFortran puede imprimir stacktraces cuando hay una excepción no controlada, " +"así como en cualquier error del compilador con la opción `--show-stacktrace`" +". Esto es muy útil para desarrollar el propio compilador para ver dónde está " +"el problema en LFortran. La compatibilidad con stacktrace está desactivada " +"de manera predeterminada; para habilitarla, compile LFortran con la opción " +"cmake `-DWITH_STACKTRACE=yes` después de instalar los requisitos previos en " +"cada plataforma según las instrucciones a continuación." #: ../../doc/src/installation.md:328 msgid "Ubuntu" -msgstr "" +msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." -msgstr "" +msgstr "En Ubuntu, `apt install binutils-dev`." #: ../../doc/src/installation.md:332 msgid "macOS" -msgstr "" +msgstr "macOS" #: ../../doc/src/installation.md:334 msgid "" @@ -1617,18 +1871,29 @@ msgid "" "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" +"Si usa el compilador Clang predeterminado en macOS, entonces los " +"seguimientos de pila deberían funcionar tanto en macOS basados en Intel como " +"en M1 (el sistema de compilación CMake invoca automáticamente la herramienta " +"`dsymtuil` y nuestras secuencias de comandos de Python para almacenar la " +"información de depuración, consulte `src/bin /CMakeLists.txt` para más " +"detalles). Si no funciona, informe un error." #: ../../doc/src/installation.md:340 msgid "" "If you do not like the default way, an alternative is to use bintutils. " "For that, first install [Spack](https://spack.io/), then:" msgstr "" +"Si no le gusta la forma predeterminada, una alternativa es usar bintutils. " +"Para eso, primero instale [Spack](https://spack.io/), luego:" #: ../../doc/src/installation.md:347 msgid "" "The last command will show a full path to the installed `binutils` " "package. Add this path to your shell config file, e.g.:" msgstr "" +"El último comando mostrará una ruta completa al paquete `binutils` " +"instalado. Agregue esta ruta a su archivo de configuración de la interfaz, " +"por ejemplo:" #: ../../doc/src/installation.md:352 msgid "" @@ -1637,18 +1902,22 @@ msgid "" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" +"y compile LFortran con la opción cmake `-DCMAKE_PREFIX_PATH=\"" +"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"`. El `$CONDA_PREFIX` está ahí si " +"instala algunas otras dependencias (como `llvm`) usando Conda, de lo " +"contrario, puede eliminarlo." #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" -msgstr "" +msgstr "Funciones intrínsecas de matriz" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" -msgstr "" +msgstr "allocated(x): verificación de estado" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." -msgstr "" +msgstr "Estado lógico de un entero asignable." #: ../../doc/src/intrinsics/array/allocated.md:5 #: ../../doc/src/intrinsics/array/cshift.md:5 @@ -1695,7 +1964,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 msgid "Declaration" -msgstr "" +msgstr "Declaración" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 @@ -1742,7 +2011,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" -msgstr "" +msgstr "Sintaxis" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 @@ -1791,11 +2060,11 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" -msgstr "" +msgstr "Argumentos" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." -msgstr "" +msgstr "`x` es un parámetro de entrada entero." #: ../../doc/src/intrinsics/array/allocated.md:18 #: ../../doc/src/intrinsics/array/cshift.md:22 @@ -1839,13 +2108,15 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" -msgstr "" +msgstr "Valores devueltos" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" "The return value is a logical scalar with the default logical kind type " "parameter." msgstr "" +"El valor devuelto es un escalar lógico con el parámetro de tipo de tipo " +"lógico predeterminado." #: ../../doc/src/intrinsics/array/allocated.md:23 #: ../../doc/src/intrinsics/array/cshift.md:26 @@ -1894,7 +2165,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" -msgstr "" +msgstr "Descripción" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" @@ -1902,6 +2173,9 @@ msgid "" " It returns a logical value as `TRUE` if the input argument `x` is " "allocated, `FALSE` otherwise." msgstr "" +"`allocated(x)` comprueba el estado de asignación de un parámetro de entrada " +"entero. Devuelve un valor lógico como `VERDADERO` si se asigna el argumento " +"de entrada `x`, `FALSO` en caso contrario." #: ../../doc/src/intrinsics/array/allocated.md:29 #: ../../doc/src/intrinsics/array/cshift.md:39 @@ -1950,14 +2224,14 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" -msgstr "" +msgstr "Tipos" #: ../../doc/src/intrinsics/array/allocated.md:31 #: ../../doc/src/intrinsics/array/size.md:35 #: ../../doc/src/intrinsics/character/achar.md:39 #: ../../doc/src/intrinsics/character/char.md:40 msgid "Supported argument type is integer." -msgstr "" +msgstr "El tipo de argumento admitido es entero." #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 @@ -2006,7 +2280,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" -msgstr "" +msgstr "Ejemplos" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 @@ -2020,7 +2294,7 @@ msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" -msgstr "" +msgstr "**Result**:" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 @@ -2069,36 +2343,40 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" -msgstr "" +msgstr "Ver también" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" -msgstr "" +msgstr "cshift(A, shift [, dim]): Desplazamiento circular" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." -msgstr "" +msgstr "Elementos de desplazamiento circular de una matriz." #: ../../doc/src/intrinsics/array/cshift.md:16 #: ../../doc/src/intrinsics/array/size.md:16 msgid "`A` the input array of any type or rank." -msgstr "" +msgstr "`A` la matriz de entrada de cualquier tipo o rango." #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." -msgstr "" +msgstr "`shift` el valor de entrada de tipo entero." #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." msgstr "" +"Dimensión opcional `dim`, si está presente, `cshift` devuelve el resultado " +"de esta dimensión." #: ../../doc/src/intrinsics/array/cshift.md:24 msgid "" "The return value is of input array type and rank as the `A` array input " "argument." msgstr "" +"El valor devuelto es del tipo de matriz de entrada y se clasifica como el " +"argumento de entrada de la matriz `A`." #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" @@ -2106,6 +2384,9 @@ msgid "" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" +"**cshift(A, shift [, dim])** realiza un desplazamiento circular en los " +"elementos de la matriz `A` a lo largo de la dimensión de `dim`. El valor " +"predeterminado de `dim` es 1, se usa cuando no se pasa `dim`." #: ../../doc/src/intrinsics/array/cshift.md:32 msgid "" @@ -2113,40 +2394,50 @@ msgid "" "`shift` places. If rank is greater than one, then all complexte rank one " "sections of array along the given dimension are shifted." msgstr "" +"Si el rango de la matriz es 1, entonces todos los elementos de la matriz se " +"desplazan en lugares de `shift`. Si el rango es mayor que uno, todas las " +"secciones complejas de rango uno de la matriz a lo largo de la dimensión " +"dada se desplazan." #: ../../doc/src/intrinsics/array/cshift.md:36 msgid "" "Elements shifted out one end of each rank one section are shifted back in" " the other end." msgstr "" +"Los elementos desplazados en un extremo de cada rango de una sección se " +"desplazan hacia atrás en el otro extremo." #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." msgstr "" +"El tipo de argumento admitido es una matriz para `A` y un número entero para " +"`shift` y `dim`." #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" -msgstr "" +msgstr "size(x): tamaño de la matriz" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." -msgstr "" +msgstr "Devuelve el tamaño de una matriz `x`." #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." msgstr "" +"Dimensión opcional `dim`, si está presente, `size` devuelve el tamaño de " +"esta dimensión." #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." -msgstr "" +msgstr "`kind` opcional el tipo del valor de retorno." #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." -msgstr "" +msgstr "`n` el tamaño de una matriz (entero)." #: ../../doc/src/intrinsics/array/size.md:28 msgid "" @@ -2155,22 +2446,27 @@ msgid "" " 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." msgstr "" +"La función intrínseca `size` devuelve el tamaño de una matriz. Devuelve el " +"producto de todas las dimensiones, a menos que se especifique el argumento " +"`dim`, en cuyo caso solo devuelve el tamaño de esta dimensión en particular. " +"El argumento `kind` se puede utilizar para especificar el tipo entero del " +"resultado." #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." -msgstr "" +msgstr "[shape](), [reshape]()." #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" -msgstr "" +msgstr "Funciones intrínsecas de bits" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" -msgstr "" +msgstr "bge(x, y): bit a bit mayor o igual" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." -msgstr "" +msgstr "Bit a bit mayor o igual que." #: ../../doc/src/intrinsics/bit/bge.md:16 #: ../../doc/src/intrinsics/bit/bgt.md:16 @@ -2178,19 +2474,23 @@ msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:16 msgid "`x` and `y` are integer input values. Both input values are of same kind." msgstr "" +"`x` e `y` son valores de entrada enteros. Ambos valores de entrada son del " +"mismo tipo." #: ../../doc/src/intrinsics/bit/bge.md:20 #: ../../doc/src/intrinsics/bit/bgt.md:20 #: ../../doc/src/intrinsics/bit/ble.md:20 #: ../../doc/src/intrinsics/bit/blt.md:20 msgid "The return value is of type logical and of the default kind." -msgstr "" +msgstr "El valor devuelto es de tipo lógico y del tipo predeterminado." #: ../../doc/src/intrinsics/bit/bge.md:24 msgid "" "`bge(x, y)` calculates if two integer input values is bitwise greater " "than or equal to another." msgstr "" +"`bge(x, y)` calcula si dos valores de entrada enteros son bit a bit mayores " +"o iguales que otro." #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 @@ -2199,6 +2499,7 @@ msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:34 msgid "Supported input types is integer of 32 bit and 64 bit size." msgstr "" +"Los tipos de entrada admitidos son números enteros de 32 bits y 64 bits." #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 @@ -2236,110 +2537,120 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" -msgstr "" +msgstr "**Result:**" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" -msgstr "" +msgstr "bgt(x, y): bit a bit mayor que" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." -msgstr "" +msgstr "Bit a bit mayor que." #: ../../doc/src/intrinsics/bit/bgt.md:24 msgid "" "`bgt(x, y)` calculates if one integer input values is bitwise greater " "than the other." msgstr "" +"`bgt(x, y)` calcula si un valor de entrada entero es bit a bit mayor que el " +"otro." #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bge](bge.md), [ble](ble.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" -msgstr "" +msgstr "bit_size(x): tamaño de bit" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." -msgstr "" +msgstr "Tamaño de bits." #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." -msgstr "" +msgstr "`x` es un valor de entrada entero." #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." -msgstr "" +msgstr "El valor devuelto es de tipo entero." #: ../../doc/src/intrinsics/bit/bit_size.md:24 msgid "" "`bit_size(x)` calculates the number of bits including sign bit of binary " "representation of `x`." msgstr "" +"`bit_size(x)` calcula el número de bits, incluido el bit de signo de la " +"representación binaria de `x`." #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." -msgstr "" +msgstr "Los tipos de entrada admitidos son enteros." #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" -msgstr "" +msgstr "bge(x, y): bit a bit menor o igual" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." -msgstr "" +msgstr "Bit a bit menor o igual que." #: ../../doc/src/intrinsics/bit/ble.md:24 msgid "" "`ble(x, y)` calculates if one integer input values is bitwise less than " "or equal to other." msgstr "" +"`ble(x, y)` calcula si un valor de entrada entero es bit a bit menor o igual " +"que otro." #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" -msgstr "" +msgstr "blt(x, y): bit a bit menor que" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." -msgstr "" +msgstr "Bit a bit menor que." #: ../../doc/src/intrinsics/bit/blt.md:24 msgid "" "`blt(x, y)` calculates if one integer input values is bitwise less than " "the other." msgstr "" +"`blt(x, y)` calcula si un valor de entrada entero es bit a bit menor que el " +"otro." #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." -msgstr "" +msgstr "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" -msgstr "" +msgstr "btest(x, pos): Prueba de bits en la posición" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." -msgstr "" +msgstr "Prueba de bits." #: ../../doc/src/intrinsics/bit/btest.md:16 msgid "" "`x` and `pos` are integer input values. Both input values are of same " "kind. `pos` represents position in `x`." msgstr "" +"`x` y `pos` son valores de entrada enteros. Ambos valores de entrada son del " +"mismo tipo. `pos` representa la posición en `x`." #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." -msgstr "" +msgstr "El valor de retorno es de tipo lógico." #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" @@ -2347,25 +2658,30 @@ msgid "" "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" +"`btest(x, pos)` calcula si el bit `pos` en el valor entero de entrada `x` " +"está establecido. El conteo de bits comienza en 0, al menos el bit " +"significativo (LSB), es decir, el bit más a la derecha en `x`." #: ../../doc/src/intrinsics/bit/btest.md:29 msgid "" "If `pos` less than 0 or greater than `bit_size()`, `btest(x, pos)` errors" " with not allowed message." msgstr "" +"Si `pos` es menor que 0 o mayor que `bit_size()`, `btest(x, pos)` tiene un " +"mensaje de error no permitido." #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" -msgstr "" +msgstr "shiftl(x, shift): Desplazamiento a la izquierda" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." -msgstr "" +msgstr "Función de desplazamiento lógico a la izquierda." #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." -msgstr "" +msgstr "`x` es un valor de entrada entero." #: ../../doc/src/intrinsics/bit/shiftl.md:18 #: ../../doc/src/intrinsics/bit/shiftr.md:18 @@ -2373,11 +2689,13 @@ msgid "" "`shift` an unsigned integer value less than or equal to the bit size of " "`x`. The possible values are 7, 31, and 63." msgstr "" +"`shift` un valor entero sin signo menor o igual que el tamaño de bit de `x`. " +"Los valores posibles son 7, 31 y 63." #: ../../doc/src/intrinsics/bit/shiftl.md:23 #: ../../doc/src/intrinsics/bit/shiftr.md:23 msgid "The return value is of type integer and of the same kind as `x`." -msgstr "" +msgstr "El valor devuelto es de tipo entero y del mismo tipo que `x`." #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" @@ -2386,6 +2704,11 @@ msgid "" "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." msgstr "" +"**shiftl(x, shift)** desplaza lógicamente a la izquierda `x` por el número " +"de bits de `shift`. `shiftl` cambia de LSB(**L**este **S**significativo " +"**B**it) a MSB(**M**más **S**significativo **B**it). Bits desplazados desde " +"el extremo izquierdo, es decir, se pierden bits MSB. Los ceros se agregan al " +"extremo derecho opuesto." #: ../../doc/src/intrinsics/bit/shiftl.md:34 #: ../../doc/src/intrinsics/bit/shiftr.md:34 @@ -2393,18 +2716,20 @@ msgid "" "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`." msgstr "" +"Tipos admitidos en valor entero sin signo `x` y valor entero sin signo " +"`shift` de (7, 31, 63) menor o igual que el tamaño de bit de `x`." #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." -msgstr "" +msgstr "[shiftr](shiftr.md)." #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" -msgstr "" +msgstr "shiftr(x, shift): Desplazamiento a la derecha" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." -msgstr "" +msgstr "Función de desplazamiento lógico a la derecha." #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" @@ -2413,28 +2738,35 @@ msgid "" "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." msgstr "" +"**shiftr(x, shift)** lógicamente desplaza a la derecha `x` por el número de " +"bits de `shift`. `shiftr` cambia de MSB(**M**más **S**significativo **B**it) " +"a LSB(**L**este **S**significativo **B**it). Bits desplazados desde el " +"extremo derecho, es decir, los bits LSB se pierden. Los ceros se añaden al " +"extremo izquierdo opuesto." #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." -msgstr "" +msgstr "[shiftl](shiftl.md)." #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" -msgstr "" +msgstr "Funciones intrínsecas de carácter" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." -msgstr "" +msgstr "achar(x, kind): Para Carácter en conjunto ASCII." #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." -msgstr "" +msgstr "Carácter representado por en el juego de caracteres ASCII." #: ../../doc/src/intrinsics/character/achar.md:16 msgid "" "`x`: the input value of integer type. `kind`: an optional input value of " "type integer constant expression for initialization." msgstr "" +"`x`: el valor de entrada de tipo entero. `kind`: un valor de entrada " +"opcional de expresión constante de tipo entero para la inicialización." #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 @@ -2442,12 +2774,12 @@ msgstr "" #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" -msgstr "" +msgstr "Valor devuelto" #: ../../doc/src/intrinsics/character/achar.md:22 #: ../../doc/src/intrinsics/character/char.md:23 msgid "The return value is of type character of length 1." -msgstr "" +msgstr "El valor de retorno es de tipo carácter de longitud 1." #: ../../doc/src/intrinsics/character/achar.md:24 #: ../../doc/src/intrinsics/character/char.md:25 @@ -2455,12 +2787,16 @@ msgid "" "The return value is of kind `kind` if optional input value is passed, " "otherwise the kind is default kind." msgstr "" +"El valor devuelto es del tipo `kind` si se pasa un valor de entrada opcional;" +" de lo contrario, el tipo es el tipo predeterminado." #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." msgstr "" +"**achar(x, kind)** devuelve el carácter representado por el juego de " +"caracteres ASCII en la posición `x`." #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 @@ -2469,30 +2805,33 @@ msgid "" "not represented in the ASCII character set, the return value is " "undefined." msgstr "" +"Si `x` está fuera del valor entero del juego de caracteres ASCII, es decir, " +"si `x` no está representado en el juego de caracteres ASCII, el valor " +"devuelto no está definido." #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." -msgstr "" +msgstr "Es una función incorporada en tiempo de ejecución." #: ../../doc/src/intrinsics/character/achar.md:71 #: ../../doc/src/intrinsics/character/adjustl.md:64 #: ../../doc/src/intrinsics/character/len_trim.md:65 msgid "[lge](lge.md)." -msgstr "" +msgstr "[lge](lge.md)." #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" -msgstr "" +msgstr "adjustl(string): ajuste de cadena a izquierda" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." -msgstr "" +msgstr "Ajusta a izquierda una cadena." #: ../../doc/src/intrinsics/character/adjustl.md:16 #: ../../doc/src/intrinsics/character/adjustr.md:16 msgid "`string`: the input value must be of character type." -msgstr "" +msgstr "`string`: el valor de entrada debe ser de tipo carácter." #: ../../doc/src/intrinsics/character/adjustl.md:20 msgid "" @@ -2500,25 +2839,30 @@ msgid "" "value `string`, with leading spaces removed and same number of spaces " "appended." msgstr "" +"El valor devuelto es de tipo carácter y del mismo tipo que el valor de " +"entrada `string`, con los espacios iniciales eliminados y el mismo número de " +"espacios añadidos." #: ../../doc/src/intrinsics/character/adjustl.md:25 msgid "" "**adjustl(string)** adjusts input string by removing any leading spaces " "and appending same number of spaces." msgstr "" +"**adjustl(cadena)** ajusta la cadena de entrada eliminando cualquier espacio " +"inicial y agregando la misma cantidad de espacios." #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." -msgstr "" +msgstr "El tipo de argumento admitido es el carácter." #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" -msgstr "" +msgstr "adjustr(cadena): Cadena ajustada a la derecha" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." -msgstr "" +msgstr "Ajuste a la derecha una cadena." #: ../../doc/src/intrinsics/character/adjustr.md:20 msgid "" @@ -2526,78 +2870,92 @@ msgid "" "value `string`, with trailing spaces removed and same number of spaces " "added at the start." msgstr "" +"El valor devuelto es de tipo carácter y del mismo tipo que el valor de " +"entrada `string`, con los espacios finales eliminados y el mismo número de " +"espacios agregados al principio." #: ../../doc/src/intrinsics/character/adjustr.md:26 msgid "" "**adjustr(string)** adjusts input string by removing any trailing spaces " "and adding same number of spaces at the start of the input string." msgstr "" +"**adjustr(cadena)** ajusta la cadena de entrada eliminando los espacios " +"finales y agregando la misma cantidad de espacios al comienzo de la cadena " +"de entrada." #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." -msgstr "" +msgstr "[adjustl](adjustl.md)." #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" -msgstr "" +msgstr "char(x, [, kind]): Transforma entero en carácter" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." -msgstr "" +msgstr "Conversión de entero a carácter." #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." -msgstr "" +msgstr "`x`: el valor de entrada de tipo entero." #: ../../doc/src/intrinsics/character/char.md:18 msgid "" "`kind`: an optional input value of type integer constant expression for " "initialization. This indicates the kind parameter of the result." msgstr "" +"`kind`: un valor de entrada opcional de expresión constante de tipo entero " +"para la inicialización. Esto indica el tipo de parámetro del resultado." #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." msgstr "" +"**char(x)** devuelve el carácter representado por el conjunto de caracteres " +"ASCII en la posición `x`." #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" -msgstr "" +msgstr "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" -msgstr "" +msgstr "len_trim(cadena): Longitud ignorando los espacios en blanco finales" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." msgstr "" +"Longitud de una cadena de caracteres que ignora los caracteres en blanco " +"finales." #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." -msgstr "" +msgstr "`string` el valor de entrada del tipo de carácter." #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." -msgstr "" +msgstr "El valor de retorno es de tipo entero sin signo." #: ../../doc/src/intrinsics/character/len_trim.md:24 msgid "" "**len_trim(string)** returns the length of the character argument without" " including trailing blank character(s)." msgstr "" +"**len_trim(cadena)** devuelve la longitud del argumento de carácter sin " +"incluir los caracteres en blanco finales." #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." -msgstr "" +msgstr "El tipo de argumento admitido es un carácter." #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" -msgstr "" +msgstr "lge(x, y): léxicamente mayor o igual" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." -msgstr "" +msgstr "Léxicamente mayor que o igual." #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." diff --git a/doc/locale/fr/LC_MESSAGES/docs.po b/doc/locale/fr/LC_MESSAGES/docs.po index af5ab6f16a..0b88299e18 100644 --- a/doc/locale/fr/LC_MESSAGES/docs.po +++ b/doc/locale/fr/LC_MESSAGES/docs.po @@ -3,18 +3,21 @@ # This file is distributed under the same license as the LFortran package. # FIRST AUTHOR , 2022. # -#, fuzzy msgid "" msgstr "" -"Project-Id-Version: LFortran \n" +"Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2022-09-05 11:19+0000\n" +"Last-Translator: Vincent Magnin \n" +"Language-Team: French \n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.14.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 @@ -31,7 +34,7 @@ msgstr "" #: ../../doc/src/ast_and_asr.ipynb:25 ../../doc/src/progress.md msgid "AST" -msgstr "" +msgstr "AST" #: ../../doc/src/ast_and_asr.ipynb:76 msgid "" @@ -43,7 +46,7 @@ msgstr "" #: ../../doc/src/ast_and_asr.ipynb:88 ../../doc/src/progress.md msgid "ASR" -msgstr "" +msgstr "ASR" #: ../../doc/src/ast_and_asr.ipynb:139 msgid "" @@ -1433,7 +1436,7 @@ msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" -msgstr "" +msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." @@ -3760,7 +3763,7 @@ msgstr "" #: ../../doc/src/progress.md msgid "LLVM" -msgstr "" +msgstr "LLVM" #: ../../doc/src/progress.md msgid "BIN" @@ -4509,4 +4512,3 @@ msgstr "" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/nint/t01_scalar_real.f90)" msgstr "" - diff --git a/doc/locale/pt/LC_MESSAGES/docs.po b/doc/locale/pt/LC_MESSAGES/docs.po index ec55fb50b6..809bdd82c0 100644 --- a/doc/locale/pt/LC_MESSAGES/docs.po +++ b/doc/locale/pt/LC_MESSAGES/docs.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-22 11:19+0000\n" +"PO-Revision-Date: 2022-09-03 06:16+0000\n" "Last-Translator: Ian Giestas Pauli \n" "Language-Team: Portuguese \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.14-dev\n" +"X-Generator: Weblate 4.14.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 @@ -357,11 +357,11 @@ msgstr "" #: ../../doc/src/contributing.md:183 msgid "The section is tested with `lfortran --show-asr examples/expr2.f90`" -msgstr "" +msgstr "A seção é testada com `lfortran --show-asr examples/expr2.f90`" #: ../../doc/src/contributing.md:184 msgid "Implement the New Token in LLVM" -msgstr "" +msgstr "Implemente o Novo Token no LLVM" #: ../../doc/src/contributing.md:186 msgid "" @@ -369,26 +369,31 @@ msgid "" " operator. We first add the two numbers then divide by two. :fontawesome-" "solid-code:*src/lfortran/codegen/asr_to_llvm.cpp*" msgstr "" +"Para implementá-lo no LLVM estendemos a tradução da BinOp (operação binária) " +"para o novo operador. Primeiro adicionamos os dois números e depois " +"dividimos por dois. :fontawesome-solid-code:*src/lfortran/codegen/asr_to_llvm" +".cpp*" #: ../../doc/src/contributing.md:217 msgid "The section is tested with `lfortran --show-llvm examples/expr2.f90`" -msgstr "" +msgstr "Esta seção é testada usando `lfortran --show-llvm examples/expr2.f90`" #: ../../doc/src/contributing.md:219 msgid "Now when LLVM works, we can test the final executable by:" msgstr "" +"Agora que o LLVM funciona, podemos finalmente testar o executável usando:" #: ../../doc/src/contributing.md:224 msgid "And it should print 6." -msgstr "" +msgstr "O que deve mostrar na tela 6." #: ../../doc/src/contributing.md:226 msgid "It also works interactively:" -msgstr "" +msgstr "Também funciona interativamente:" #: ../../doc/src/contributing.md:242 msgid "Reach Out" -msgstr "" +msgstr "Entre em contato" #: ../../doc/src/contributing.md:244 msgid "" @@ -396,6 +401,9 @@ msgid "" "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" +"Se você tiver alguma dúvida ou precisa de ajuda, por favor pergunte na nossa " +"[lista de e-mail](https://groups.io/g/lfortran) ou no [chat](https://lfortran" +".zulipchat.com/)." #: ../../doc/src/contributing.md:248 msgid "" @@ -404,6 +412,10 @@ msgid "" "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" +"Por favor, note que todos os participantes deste projeto devem seguir nosso " +"Código de Conduta. Ao participar deste projeto, você concorda em cumprir " +"seus termos. Consulte [CODE_OF_CONDUCT.md](https://github.com/lfortran/" +"lfortran/blob/main/CODE_OF_CONDUCT.md)." #: ../../doc/src/contributing.md:252 msgid "" @@ -412,14 +424,17 @@ msgid "" "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" +"Ao enviar um PR, você concorda em licenciar sua contribuição sob a [licença " +"BSD](https://github.com/lfortran/lfortran/blob/main/LICENSE) da LFortran, " +"menos nos casos em que é explicitamente dito o contrário." #: ../../doc/src/design.md:1 msgid "LFortran Design" -msgstr "" +msgstr "Design do LFortran" #: ../../doc/src/design.md:3 msgid "High Level Overview" -msgstr "" +msgstr "Visão Geral de Alto Nível" #: ../../doc/src/design.md:5 ../../doc/src/developer_tutorial.ipynb:16 msgid "" @@ -428,6 +443,10 @@ msgid "" "and users are encouraged to use them independently for other applications" " and build tools on top:" msgstr "" +"LFortran está estruturado em torno de dois módulos independentes, AST e ASR, " +"ambos autônomos (completamente independentes do resto do projeto) e os " +"utilizadores são encorajados a utilizá-los independentemente para outras " +"aplicações e a construir ferramentas com base nisso:" #: ../../doc/src/design.md:10 msgid "" @@ -435,6 +454,9 @@ msgid "" " source code, strictly based on syntax, no semantic is included. The AST " "module can convert itself to Fortran source code." msgstr "" +"Árvore de Sintaxe Abstrata (AST), módulo `lfortran.ast`: representa qualquer " +"código-fonte Fortran, estritamente baseado na sintaxe, nenhuma semântica " +"está incluída. O módulo AST pode ser convertido em código em Fortran." #: ../../doc/src/design.md:14 msgid "" @@ -443,20 +465,25 @@ msgid "" "code is not allowed (an error will be given). The ASR module can convert " "itself to an AST." msgstr "" +"Representação Semântica Abstrata (ASR), o módulo `lfortran.asr`: representa " +"um código-fonte Fortran válido, toda a semântica está incluída. Não é " +"permitido códigos inválidos em Fortran (será dado um erro). O módulo ASR " +"pode ser convertido em uma AST." #: ../../doc/src/design.md:19 msgid "" "The LFortran compiler is then composed of the following independent " "stages:" msgstr "" +"O compilador LFortran é então composto pelas seguintes etapas independentes:" #: ../../doc/src/design.md:21 msgid "Parsing: converts Fortran source code to an AST" -msgstr "" +msgstr "Análise: converte o código-fonte Fortran em uma AST" #: ../../doc/src/design.md:22 msgid "Semantic: converts an AST to an ASR" -msgstr "" +msgstr "Semântica: converte uma AST em uma ASR" #: ../../doc/src/design.md:23 msgid "" @@ -464,6 +491,9 @@ msgid "" "(things like inlining functions, eliminating redundant expressions or " "statements, etc.)" msgstr "" +"Otimizações de alto nível: otimiza a ASR para uma simplificá-la e " +"possivelmente torná-la mais rápida (coisas como alinhamento de funções, " +"eliminação de expressões ou comandos redundantes, etc.)" #: ../../doc/src/design.md:26 msgid "" @@ -471,6 +501,9 @@ msgid "" " 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." msgstr "" +"Geração de código LLVM IR e otimizações de baixo nível: converte uma ASR em " +"uma LLVM IR. Nesta etapa são feitas outras otimizações que não produzem uma " +"ASR, porém ainda faz sentido fazê-las antes de passá-las ao LLVM IR." #: ../../doc/src/design.md:29 msgid "" @@ -479,6 +512,10 @@ msgid "" " file, or it is loaded and executed using JIT as part of the interactive " "LFortran session or in a Jupyter kernel)." msgstr "" +"Geração de código de máquina: LLVM fará todas as suas otimizações e gerará " +"código de máquina (como um executável, uma biblioteca, um arquivo objeto, ou " +"carregado e executado usando JIT como parte de uma sessão interativa " +"LFortran ou em um kernel do Jupyter)." #: ../../doc/src/design.md:34 msgid "" @@ -490,56 +527,70 @@ msgid "" "machine code directly. In other words, one can use LFortran to easily " "convert between the three equivalent representations:" msgstr "" +"O LFortran está estruturado em forma de uma biblioteca, podendo ser usado " +"para obter uma AST, ou usar o analisador semântico para obter uma ASR, " +"podendo usá-las em uma aplicação. Também é possível gerar uma ASR " +"diretamente (Ex: a partir do SymPy) e depois convertê-la a uma AST, para em " +"seguida montar um código em Fortran, ou usar o LFortran para compilá-la em " +"código de máquina diretamente. Em outras palavras, é fácil usar o LFortran " +"para converter facilmente entre às três representações equivalentes:" #: ../../doc/src/design.md:42 msgid "Fortran source code" -msgstr "" +msgstr "Código-fonte em Fortran" #: ../../doc/src/design.md:43 ../../doc/src/developer_tutorial.ipynb:23 msgid "Abstract Syntax Tree (AST)" -msgstr "" +msgstr "Árvore de Sintaxe Abstrata (AST)" #: ../../doc/src/design.md:44 ../../doc/src/developer_tutorial.ipynb:159 msgid "Abstract Semantic Representation (ASR)" -msgstr "" +msgstr "Representação Semântica Abstrata (ASR)" #: ../../doc/src/design.md:46 msgid "They are all equivalent in the following sense:" -msgstr "" +msgstr "São todos equivalentes, no seguinte sentido:" #: ../../doc/src/design.md:48 msgid "Any ASR can always be converted to an equivalent AST" -msgstr "" +msgstr "Qualquer ASR pode ser convertida em uma AST equivalente" #: ../../doc/src/design.md:49 msgid "Any AST can always be converted to an equivalent Fortran source code" msgstr "" +"Qualquer AST pode sempre ser convertida em um código Fortran equivalente" #: ../../doc/src/design.md:50 msgid "" "Any Fortran source code can always be either converted to an equivalent " "AST or one gets a syntax error" msgstr "" +"Qualquer código-fonte em Fortran pode ser sempre convertido em uma AST " +"equivalente ou é emitido um erro de sintaxe" #: ../../doc/src/design.md:52 msgid "" "Any AST can always be either converted to an equivalent ASR or one gets a" " semantic error" msgstr "" +"Qualquer AST pode ser sempre convertida em uma ASR equivalente ou é emitido " +"um erro de semântica" #: ../../doc/src/design.md:55 msgid "" "So when a conversion can be done, they are equivalent, and the conversion" " can always be done unless the code is invalid." msgstr "" +"Então, quando a conversão pode ser realizada, são equivalentes, e esta pode " +"sempre ser realizada, exceto no caso em que o código é invalido." #: ../../doc/src/design.md:58 msgid "ASR Design Details" -msgstr "" +msgstr "Detalhes do design da ASR" #: ../../doc/src/design.md:60 msgid "The ASR is designed to have the following features:" -msgstr "" +msgstr "A ASR foi imaginada para ter os seguintes recursos:" #: ../../doc/src/design.md:62 msgid "" @@ -547,12 +598,17 @@ msgid "" " not lose any semantic information). ASR can be converted to AST, and AST" " to Fortran source code which is functionally equivalent to the original." msgstr "" +"A ASR sempre é equivalente semanticamente ao código original Fortran (não " +"perde nenhuma informação). A ASR pode ser convertida em uma AST, e a AST em " +"código-fonte cuja funcionalidade é idêntica a original." #: ../../doc/src/design.md:66 msgid "" "ASR is as simple as possible: it does not contain any information that " "could not be inferred from ASR." msgstr "" +"A ASR é a mais simples possível: não contém nenhuma informação que não pode " +"ser inferida de uma ASR." #: ../../doc/src/design.md:69 msgid "" @@ -573,7 +629,7 @@ msgstr "" #: ../../doc/src/design.md:82 msgid "Notes:" -msgstr "" +msgstr "Notas:" #: ../../doc/src/design.md:84 msgid "" @@ -581,6 +637,9 @@ msgid "" "multiline/single line if statement distinction, case sensitivity of " "keywords." msgstr "" +"Informação perdida ao construir a ASR a partir do código-fonte: espaços em " +"branco, distinção entre os comandos if na mesma linha e if ao longo de " +"várias linhas, além das letras maiúsculas e minúsculas em palavras-chave." #: ../../doc/src/design.md:87 msgid "" @@ -591,6 +650,11 @@ msgid "" "order), as ASR only represents the aggregated type information in the " "symbol table." msgstr "" +"Informação perdida quando transformando uma AST em ASR: sintaxe detalhada de " +"como as variáveis foram definidas e a ordem dos atributos de tipo (se a " +"dimensão de um array está usando o atributo `dimension` ou uma expressão " +"parentesada, ou ainda quantas variáveis existiam na linha, ou sua ordem), já " +"que a ASR apenas representa as informações de tipo em uma tabela de símbolos." #: ../../doc/src/design.md:90 msgid "" @@ -623,7 +687,7 @@ msgstr "" #: ../../doc/src/design.md:109 msgid "Fortran 2008" -msgstr "" +msgstr "Fortran 2008" #: ../../doc/src/design.md:111 msgid "" @@ -635,15 +699,15 @@ msgstr "" #: ../../doc/src/design.md:116 ../../doc/src/design.md:131 msgid "main program" -msgstr "" +msgstr "Programa principal" #: ../../doc/src/design.md:117 ../../doc/src/design.md:132 msgid "module or submodule" -msgstr "" +msgstr "módulo ou submódulo" #: ../../doc/src/design.md:118 ../../doc/src/design.md:133 msgid "function or subroutine" -msgstr "" +msgstr "função ou sub-rotina" #: ../../doc/src/design.md:120 msgid "" @@ -654,7 +718,7 @@ msgstr "" #: ../../doc/src/design.md:124 msgid "LFortran Extension" -msgstr "" +msgstr "Extensão do LFortran" #: ../../doc/src/design.md:126 msgid "" @@ -666,19 +730,19 @@ msgstr "" #: ../../doc/src/design.md:134 msgid "use statement" -msgstr "" +msgstr "comando use" #: ../../doc/src/design.md:135 msgid "declaration" -msgstr "" +msgstr "declaração" #: ../../doc/src/design.md:136 msgid "statement" -msgstr "" +msgstr "comando" #: ../../doc/src/design.md:137 msgid "expression" -msgstr "" +msgstr "expressão" #: ../../doc/src/design.md:139 msgid "" @@ -746,23 +810,23 @@ msgstr "" #: ../../doc/src/design.md:178 msgid "Example 1" -msgstr "" +msgstr "Exemplo 1" #: ../../doc/src/design.md:185 msgid "Example 2" -msgstr "" +msgstr "Exemplo 2" #: ../../doc/src/design.md:197 msgid "Example 3" -msgstr "" +msgstr "Exemplo 3" #: ../../doc/src/design.md:209 msgid "Example 4" -msgstr "" +msgstr "Exemplo 4" #: ../../doc/src/design.md:217 msgid "Design Considerations" -msgstr "" +msgstr "Considerações de Design" #: ../../doc/src/design.md:219 msgid "" @@ -784,7 +848,7 @@ msgstr "" #: ../../doc/src/developer_tutorial.ipynb:9 msgid "Developer Tutorial" -msgstr "" +msgstr "Tutorial de Desenvolvedor" #: ../../doc/src/developer_tutorial.ipynb:11 msgid "" @@ -794,7 +858,7 @@ msgstr "" #: ../../doc/src/developer_tutorial.ipynb:14 msgid "Introduction" -msgstr "" +msgstr "Introdução" #: ../../doc/src/developer_tutorial.ipynb:18 msgid "" @@ -845,23 +909,23 @@ msgstr "" #: ../../doc/src/index.md:134 msgid "Getting started" -msgstr "" +msgstr "Começando" #: ../../doc/src/index.md:141 ../../doc/src/progress.md:1 msgid "LFortran Development Status" -msgstr "" +msgstr "Progresso no Desenvolvimento do LFortran" #: ../../doc/src/index.md:147 msgid "Developer's Guide" -msgstr "" +msgstr "Guia do Desenvolvedor" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" -msgstr "" +msgstr "Funções Intrínsecas do LFortran" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" -msgstr "" +msgstr "Documentação do LFortran" #: ../../doc/src/index.md:3 msgid "" @@ -885,11 +949,11 @@ msgstr "" #: ../../doc/src/index.md:9 msgid "Binder" -msgstr "" +msgstr "Binder" #: ../../doc/src/index.md:16 msgid "Feature Highlights" -msgstr "" +msgstr "Recursos em Destaque" #: ../../doc/src/index.md:18 msgid "" @@ -901,7 +965,7 @@ msgstr "" #: ../../doc/src/index.md:21 msgid "Works today" -msgstr "" +msgstr "Funciona atualmente" #: ../../doc/src/index.md:23 #, python-format @@ -947,7 +1011,7 @@ msgstr "" #: ../../doc/src/index.md:51 msgid "Planned" -msgstr "" +msgstr "Planejado" #: ../../doc/src/index.md:53 msgid "" @@ -991,8 +1055,9 @@ msgid "" msgstr "" #: ../../doc/src/index.md:81 +#, fuzzy msgid "Roadmap" -msgstr "" +msgstr "Guia dos planos" #: ../../doc/src/index.md:83 msgid "Here is our roadmap how to get all the planned features above implemented:" @@ -1074,7 +1139,7 @@ msgstr "" #: ../../doc/src/installation.md:1 msgid "Installation" -msgstr "" +msgstr "Instalação" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." @@ -1082,7 +1147,7 @@ msgstr "" #: ../../doc/src/installation.md:5 msgid "Binaries" -msgstr "" +msgstr "Binários" #: ../../doc/src/installation.md:7 msgid "" @@ -1117,7 +1182,7 @@ msgstr "" #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." -msgstr "" +msgstr "E selecionando `New->Fortran`." #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" @@ -1143,7 +1208,7 @@ msgstr "" #: ../../doc/src/installation.md:52 msgid "And build:" -msgstr "" +msgstr "E compile:" #: ../../doc/src/installation.md:58 msgid "This will install the `lfortran` into the `inst/bin`." @@ -1187,7 +1252,7 @@ msgstr "" #: ../../doc/src/installation.md:92 msgid "Run tests:" -msgstr "" +msgstr "Rode os testes:" #: ../../doc/src/installation.md:97 msgid "Run an interactive prompt:" @@ -1236,7 +1301,7 @@ msgstr "" #: ../../doc/src/installation.md:140 msgid "And so on." -msgstr "" +msgstr "E assim por diante." #: ../../doc/src/installation.md:142 msgid "" @@ -1296,11 +1361,11 @@ msgstr "" #: ../../doc/src/installation.md:174 msgid "Run the following" -msgstr "" +msgstr "Execute o seguinte" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" -msgstr "" +msgstr "Reinicie novamente o Ubuntu" #: ../../doc/src/installation.md:187 msgid "" @@ -1310,7 +1375,7 @@ msgstr "" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" -msgstr "" +msgstr "Ex: `cd mnt/c/Users/name/source/repos/`" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" @@ -1330,7 +1395,7 @@ msgstr "" #: ../../doc/src/installation.md:215 msgid "Run tests" -msgstr "" +msgstr "Rode os testes" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" @@ -1374,7 +1439,7 @@ msgstr "" #: ../../doc/src/installation.md:258 msgid "With Root" -msgstr "" +msgstr "Com Root" #: ../../doc/src/installation.md:260 msgid "" @@ -1385,7 +1450,7 @@ msgstr "" #: ../../doc/src/installation.md:264 msgid "Without Root" -msgstr "" +msgstr "Sem Root" #: ../../doc/src/installation.md:266 msgid "" @@ -1402,7 +1467,7 @@ msgstr "" #: ../../doc/src/installation.md:278 msgid "Development" -msgstr "" +msgstr "Desenvolvimento" #: ../../doc/src/installation.md:280 msgid "Now we can enter the development environment:" @@ -1426,7 +1491,7 @@ msgstr "" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" -msgstr "" +msgstr "Nota Sobre Dependências" #: ../../doc/src/installation.md:299 msgid "" @@ -1457,18 +1522,23 @@ msgid "" msgstr "" #: ../../doc/src/installation.md:314 +#, fuzzy msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" -msgstr "" +msgstr "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" #: ../../doc/src/installation.md:315 +#, fuzzy msgid "" "[LLVM - 11.0.1](https://github.com/llvm/llvm-" "project/releases/download/llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" msgstr "" +"[LLVM - 11.0.1](https://github.com/llvm/llvm-project/releases/download/" +"llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" #: ../../doc/src/installation.md:316 +#, fuzzy msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" -msgstr "" +msgstr "[re2c - 2.0.3](https://re2c.org/install/install.html)" #: ../../doc/src/installation.md:317 msgid "" @@ -1479,8 +1549,9 @@ msgid "" msgstr "" #: ../../doc/src/installation.md:319 +#, fuzzy msgid "Stacktraces" -msgstr "" +msgstr "Stacktraces" #: ../../doc/src/installation.md:321 msgid "" @@ -1495,7 +1566,7 @@ msgstr "" #: ../../doc/src/installation.md:328 msgid "Ubuntu" -msgstr "" +msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." @@ -1503,7 +1574,7 @@ msgstr "" #: ../../doc/src/installation.md:332 msgid "macOS" -msgstr "" +msgstr "macOS" #: ../../doc/src/installation.md:334 msgid "" @@ -1536,11 +1607,11 @@ msgstr "" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" -msgstr "" +msgstr "Funções Intrínsecas em Arrays" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" -msgstr "" +msgstr "allocated(x): Checagem de Condição" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." @@ -1590,8 +1661,9 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:5 #: ../../doc/src/intrinsics/numeric/gamma.md:5 #: ../../doc/src/intrinsics/numeric/mod.md:5 +#, fuzzy msgid "Declaration" -msgstr "" +msgstr "Declaração" #: ../../doc/src/intrinsics/array/allocated.md:7 #: ../../doc/src/intrinsics/array/cshift.md:7 @@ -1638,7 +1710,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" -msgstr "" +msgstr "Sintaxe" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 @@ -1687,7 +1759,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" -msgstr "" +msgstr "Argumentos" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." @@ -1735,7 +1807,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:19 #: ../../doc/src/intrinsics/numeric/mod.md:22 msgid "Return values" -msgstr "" +msgstr "Valores de retorno" #: ../../doc/src/intrinsics/array/allocated.md:20 msgid "" @@ -1790,7 +1862,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:23 #: ../../doc/src/intrinsics/numeric/mod.md:31 ../../doc/src/progress.md msgid "Description" -msgstr "" +msgstr "Descrição" #: ../../doc/src/intrinsics/array/allocated.md:25 msgid "" @@ -1846,7 +1918,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" -msgstr "" +msgstr "Tipos" #: ../../doc/src/intrinsics/array/allocated.md:31 #: ../../doc/src/intrinsics/array/size.md:35 @@ -1902,7 +1974,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" -msgstr "" +msgstr "Exemplos" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 @@ -1916,7 +1988,7 @@ msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" -msgstr "" +msgstr "**Resultado**:" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 @@ -1965,7 +2037,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:74 #: ../../doc/src/intrinsics/numeric/mod.md:95 msgid "See Also" -msgstr "" +msgstr "Veja Também" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" @@ -2053,12 +2125,13 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/array/size.md:57 +#, fuzzy msgid "[shape](), [reshape]()." -msgstr "" +msgstr "[shape](), [reshape]()." #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" -msgstr "" +msgstr "Funções Intrínsecas de Bits" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" @@ -2132,11 +2205,12 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" -msgstr "" +msgstr "**Resultado:**" #: ../../doc/src/intrinsics/bit/bge.md:70 +#, fuzzy msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" @@ -2144,7 +2218,7 @@ msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." -msgstr "" +msgstr "Maior que bit-a-bit." #: ../../doc/src/intrinsics/bit/bgt.md:24 msgid "" @@ -2153,12 +2227,13 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/bit/bgt.md:68 +#, fuzzy msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bge](bge.md), [ble](ble.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" -msgstr "" +msgstr "bit_size(x): Tamanho em Bits" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." @@ -2198,8 +2273,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/bit/ble.md:70 +#, fuzzy msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" @@ -2207,7 +2283,7 @@ msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." -msgstr "" +msgstr "Menor que bit-a-bit." #: ../../doc/src/intrinsics/bit/blt.md:24 msgid "" @@ -2216,8 +2292,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:68 +#, fuzzy msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." -msgstr "" +msgstr "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" @@ -2225,7 +2302,7 @@ msgstr "" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." -msgstr "" +msgstr "Teste de bit." #: ../../doc/src/intrinsics/bit/btest.md:16 msgid "" @@ -2291,8 +2368,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/bit/shiftl.md:82 +#, fuzzy msgid "[shiftr](shiftr.md)." -msgstr "" +msgstr "[shiftr](shiftr.md)." #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" @@ -2311,12 +2389,13 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/bit/shiftr.md:82 +#, fuzzy msgid "[shiftl](shiftl.md)." -msgstr "" +msgstr "[shiftl](shiftl.md)." #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" -msgstr "" +msgstr "Funções Intrínsecas para Caracteres" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." @@ -2338,7 +2417,7 @@ msgstr "" #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" -msgstr "" +msgstr "Valor de retorno" #: ../../doc/src/intrinsics/character/achar.md:22 #: ../../doc/src/intrinsics/character/char.md:23 @@ -2374,8 +2453,9 @@ msgstr "" #: ../../doc/src/intrinsics/character/achar.md:71 #: ../../doc/src/intrinsics/character/adjustl.md:64 #: ../../doc/src/intrinsics/character/len_trim.md:65 +#, fuzzy msgid "[lge](lge.md)." -msgstr "" +msgstr "[lge](lge.md)." #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" @@ -2430,8 +2510,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/character/adjustr.md:65 +#, fuzzy msgid "[adjustl](adjustl.md)." -msgstr "" +msgstr "[adjustl](adjustl.md)." #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" @@ -2458,8 +2539,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/character/char.md:71 +#, fuzzy msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" -msgstr "" +msgstr "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" @@ -2531,8 +2613,9 @@ msgid "Argument types should be of type character literal." msgstr "" #: ../../doc/src/intrinsics/character/lge.md:81 +#, fuzzy msgid "[len_trim](len_trim.md)." -msgstr "" +msgstr "[len_trim](len_trim.md)." #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" @@ -2572,7 +2655,7 @@ msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:41 #: ../../doc/src/intrinsics/misc/new_line.md:58 msgid "None." -msgstr "" +msgstr "Nenhum." #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" @@ -2624,8 +2707,9 @@ msgid "Supported argument types float, double, complex float, complex double." msgstr "" #: ../../doc/src/intrinsics/mathematical/acos.md:84 +#, fuzzy msgid "[asin](asin.md), [atan](atan.md)." -msgstr "" +msgstr "[asin](asin.md), [atan](atan.md)." #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" @@ -2680,8 +2764,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 +#, fuzzy msgid "[asinh](asinh.md), [atanh](atanh.md)." -msgstr "" +msgstr "[asinh](asinh.md), [atanh](atanh.md)." #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" @@ -2703,8 +2788,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/mathematical/asin.md:84 +#, fuzzy msgid "[acos](acos.md), [atan](atan.md)." -msgstr "" +msgstr "[acos](acos.md), [atan](atan.md)." #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" @@ -2729,8 +2815,9 @@ msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" msgstr "" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 +#, fuzzy msgid "[acosh](acosh.md), [atanh](atanh.md)." -msgstr "" +msgstr "[acosh](acosh.md), [atanh](atanh.md)." #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" @@ -2753,8 +2840,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:84 +#, fuzzy msgid "[asin](asin.md), [acos](acos.md)." -msgstr "" +msgstr "[asin](asin.md), [acos](acos.md)." #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" @@ -2798,8 +2886,9 @@ msgid "It is also represented as:" msgstr "" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 +#, fuzzy msgid "$tan^{-1}(\\frac{y}{x})$" -msgstr "" +msgstr "$tan^{-1}(\\frac{y}{x})$" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" @@ -2869,8 +2958,9 @@ msgid "$-1.0 < atanh(x) < 1.0$" msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 +#, fuzzy msgid "[asinh](asinh.md), [acosh](acosh.md)." -msgstr "" +msgstr "[asinh](asinh.md), [acosh](acosh.md)." #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" @@ -2930,7 +3020,7 @@ msgstr "" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." -msgstr "" +msgstr "Qualquer um." #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" @@ -3051,8 +3141,9 @@ msgid "Unavailable or errorneous date and time parameters return blanks." msgstr "" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 +#, fuzzy msgid "[cpu_time](cpu_time.md)." -msgstr "" +msgstr "[cpu_time](cpu_time.md)." #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" @@ -3094,7 +3185,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." -msgstr "" +msgstr "Valor absoluto." #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." @@ -3113,8 +3204,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:29 +#, fuzzy msgid "$|x|$" -msgstr "" +msgstr "$|x|$" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" @@ -3134,8 +3226,9 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/abs.md:98 #: ../../doc/src/intrinsics/numeric/aimag.md:70 #: ../../doc/src/intrinsics/numeric/mod.md:97 +#, fuzzy msgid "[ceiling](ceiling.md), [floor](floor.md)." -msgstr "" +msgstr "[ceiling](ceiling.md), [floor](floor.md)." #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" @@ -3233,8 +3326,9 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 +#, fuzzy msgid "[ceiling](ceiling.md), [mod](mod.md)." -msgstr "" +msgstr "[ceiling](ceiling.md), [mod](mod.md)." #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" @@ -3263,8 +3357,9 @@ msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." msgstr "" #: ../../doc/src/intrinsics/numeric/anint.md:60 +#, fuzzy msgid "[aint](aint.md)." -msgstr "" +msgstr "[aint](aint.md)." #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" @@ -3291,8 +3386,9 @@ msgid "Supported input parameter types are integer and real." msgstr "" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 +#, fuzzy msgid "[floor](floor.md), [mod](mod.md)." -msgstr "" +msgstr "[floor](floor.md), [mod](mod.md)." #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" @@ -3417,12 +3513,13 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 +#, fuzzy msgid "epsilon(x): Epsilon" -msgstr "" +msgstr "epsilon(x): Epsilon" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." -msgstr "" +msgstr "Função Epsilon." #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." @@ -3440,11 +3537,11 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" -msgstr "" +msgstr "erf(x): Erro" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." -msgstr "" +msgstr "Função Erro." #: ../../doc/src/intrinsics/numeric/erf.md:20 msgid "" @@ -3464,12 +3561,14 @@ msgid "$-1 \\leq erf (x) \\leq 1$" msgstr "" #: ../../doc/src/intrinsics/numeric/erf.md:31 +#, fuzzy msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" -msgstr "" +msgstr "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" #: ../../doc/src/intrinsics/numeric/erf.md:69 +#, fuzzy msgid "[erfc](erfc.md)." -msgstr "" +msgstr "[erfc](erfc.md)." #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" @@ -3490,8 +3589,9 @@ msgid "$0 \\leq erf (x) \\leq 2$" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:31 +#, fuzzy msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" -msgstr "" +msgstr "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" #: ../../doc/src/intrinsics/numeric/erfc.md:33 msgid "" @@ -3500,16 +3600,17 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:72 +#, fuzzy msgid "[erf](erf.md)." -msgstr "" +msgstr "[erf](erf.md)." #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" -msgstr "" +msgstr "exp(x): Exponencial" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." -msgstr "" +msgstr "Função Exponencial." #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." @@ -3568,11 +3669,11 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" -msgstr "" +msgstr "gamma(x): Gama" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." -msgstr "" +msgstr "Função Gama." #: ../../doc/src/intrinsics/numeric/gamma.md:16 msgid "" @@ -3613,8 +3714,9 @@ msgid "" msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:76 +#, fuzzy msgid "[epsilon](epsilon.md)" -msgstr "" +msgstr "[epsilon](epsilon.md)" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" @@ -3670,7 +3772,7 @@ msgstr "" #: ../../doc/src/language.md:1 msgid "Fortran Language" -msgstr "" +msgstr "Linguagem Fortran" #: ../../doc/src/language.md:3 msgid "Background and Motivation" @@ -3689,7 +3791,7 @@ msgstr "" #: ../../doc/src/language.md:12 msgid "Some highlights:" -msgstr "" +msgstr "Alguns destaques:" #: ../../doc/src/language.md:14 msgid "" @@ -3706,11 +3808,11 @@ msgstr "" #: ../../doc/src/language.md:19 msgid "Complex numbers;" -msgstr "" +msgstr "Números complexos;" #: ../../doc/src/language.md:20 msgid "Special functions;" -msgstr "" +msgstr "Funções especiais;" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." @@ -3806,11 +3908,11 @@ msgstr "" #: ../../doc/src/progress.md:32 msgid "Topics" -msgstr "" +msgstr "Tópicos" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" -msgstr "" +msgstr "Programas completos em que fazemos cálculo de algo interessante" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" @@ -3818,59 +3920,68 @@ msgstr "" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" -msgstr "" +msgstr "Diretório: `tests/programs/numerics`" #: ../../doc/src/progress.md msgid "LLVM" -msgstr "" +msgstr "LLVM" #: ../../doc/src/progress.md +#, fuzzy msgid "BIN" -msgstr "" +msgstr "BIN" #: ../../doc/src/progress.md +#, fuzzy msgid "RUN" -msgstr "" +msgstr "RUN" #: ../../doc/src/progress.md msgid "Filename" -msgstr "" +msgstr "Nome do arquivo" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" -msgstr "" +msgstr "`Implementação em Fortran puro de sin(x)`" #: ../../doc/src/progress.md +#, fuzzy msgid "✅" -msgstr "" +msgstr "✅" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/programs/numerics/t01_sin_implementation.f90)" msgstr "" +"[t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/programs/numerics/t01_sin_implementation.f90)" #: ../../doc/src/progress.md:45 msgid "Modules" -msgstr "" +msgstr "Módulos" #: ../../doc/src/progress.md:47 msgid "Basic Usage" -msgstr "" +msgstr "Utilização básica" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" -msgstr "" +msgstr "Diretório: `tests/modules/basic`" #: ../../doc/src/progress.md msgid "`Basic modules`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/basic/t01.f90)" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" -msgstr "" +msgstr "Sub-rotinas e Funções dos Módulos" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" @@ -3881,28 +3992,37 @@ msgid "`Module functions`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t01.f90)" #: ../../doc/src/progress.md msgid "`Module subroutines`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" +"[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t02.f90)" #: ../../doc/src/progress.md msgid "`Nested subroutines`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" +"[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t03.f90)" #: ../../doc/src/progress.md:67 msgid "Expressions" -msgstr "" +msgstr "Expressões" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" @@ -3913,44 +4033,58 @@ msgid "Directory: `tests/expressions/arit`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "`+,-,*,/,**`" -msgstr "" +msgstr "`+,-,*,/,**`" #: ../../doc/src/progress.md +#, fuzzy msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" +"[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/arit/basic_operations.f90)" #: ../../doc/src/progress.md:78 msgid "Integers" -msgstr "" +msgstr "Inteiros" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "`integers`" -msgstr "" +msgstr "`integers`" #: ../../doc/src/progress.md +#, fuzzy msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" +"[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/integers/integer_kind.f90)" #: ../../doc/src/progress.md msgid "`relational operations`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t01_rel_operations.f90)" msgstr "" +"[t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/integers/t01_rel_operations.f90)" #: ../../doc/src/progress.md msgid "`logical operations`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t02_logical_operations.f90)" msgstr "" +"[t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/expressions/integers/t02_logical_operations.f90)" #: ../../doc/src/progress.md:89 msgid "Real Numbers" @@ -3965,20 +4099,27 @@ msgid "`single/double reals`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" +"[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/reals/real_kind.f90)" #: ../../doc/src/progress.md msgid "`defined operator`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "❌" -msgstr "" +msgstr "❌" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/t01_def_op.f90)" msgstr "" +"[t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/reals/t01_def_op.f90)" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" @@ -3990,191 +4131,237 @@ msgstr "" #: ../../doc/src/progress.md msgid "`single/double complex`" -msgstr "" +msgstr "`número complexo de precisão simples/dupla`" #: ../../doc/src/progress.md +#, fuzzy msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" +"[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/complex/complex_kind.f90)" #: ../../doc/src/progress.md:108 msgid "Strings" -msgstr "" +msgstr "Cadeia de Caracteres" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" -msgstr "" +msgstr "Diretório: `tests/expressions/character`" #: ../../doc/src/progress.md +#, fuzzy msgid "`character`" -msgstr "" +msgstr "`character`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" +"[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/character/t01_character.f90)" #: ../../doc/src/progress.md msgid "`string concatenation`" -msgstr "" +msgstr "`concatenação de cadeias de caracteres`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t02_concat_operation.f90)" msgstr "" +"[t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/expressions/character/t02_concat_operation.f90)" #: ../../doc/src/progress.md:118 msgid "Derived Types" -msgstr "" +msgstr "Tipos Derivados" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" -msgstr "" +msgstr "Diretório: `tests/expressions/derived_type`" #: ../../doc/src/progress.md msgid "`basic derived types`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_derived_type.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/derived_type/t01_derived_type.f90)" msgstr "" +"[t01_derived_type.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/derived_type/t01_derived_type.f90)" #: ../../doc/src/progress.md:127 msgid "Statements" -msgstr "" +msgstr "Comandos" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" -msgstr "" +msgstr "Comando Allocate" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" -msgstr "" +msgstr "Diretório: `tests/statements/allocate`" #: ../../doc/src/progress.md msgid "`allocate statement`" -msgstr "" +msgstr "`comando allocate`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/allocate/t01.f90)" #: ../../doc/src/progress.md:138 msgid "Block Statement" -msgstr "" +msgstr "Comando Block" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" -msgstr "" +msgstr "Diretório: `tests/statements/block`" #: ../../doc/src/progress.md msgid "`block statement`" -msgstr "" +msgstr "`comando block`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/block/t01.f90)" #: ../../doc/src/progress.md:147 msgid "Goto Statement" -msgstr "" +msgstr "Comando Goto" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" -msgstr "" +msgstr "Diretório: `tests/statements/goto`" #: ../../doc/src/progress.md msgid "`computed go-to statement`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/goto/t01.f90)" #: ../../doc/src/progress.md msgid "`go-to statement`" -msgstr "" +msgstr "`comando go-to`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" +"[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/goto/t02.f90)" #: ../../doc/src/progress.md:157 msgid "If Statement" -msgstr "" +msgstr "Comando if" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" -msgstr "" +msgstr "Diretório: `tests/statements/if`" #: ../../doc/src/progress.md msgid "`Test .false.`" -msgstr "" +msgstr "`Teste .false.`" #: ../../doc/src/progress.md +#, fuzzy msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" +"[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_01.f90)" #: ../../doc/src/progress.md msgid "`single line if statement`" -msgstr "" +msgstr "`comando if na mesma linha`" #: ../../doc/src/progress.md +#, fuzzy msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" +"[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_02.f90)" #: ../../doc/src/progress.md msgid "`multi line if statement`" -msgstr "" +msgstr "`comando if ao longo de várias linhas`" #: ../../doc/src/progress.md +#, fuzzy msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" +"[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_03.f90)" #: ../../doc/src/progress.md msgid "`nested if statements`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" +"[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_04.f90)" #: ../../doc/src/progress.md:169 msgid "While Statement" -msgstr "" +msgstr "Comando While" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" -msgstr "" +msgstr "Diretório: `tests/statements/while`" #: ../../doc/src/progress.md msgid "`Simple while loops`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" +"[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/statements/while/while_01.f90)" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" -msgstr "" +msgstr "`exit / cycle em laços while`" #: ../../doc/src/progress.md +#, fuzzy msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" +"[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/statements/while/while_02.f90)" #: ../../doc/src/progress.md:179 msgid "Print Statement" -msgstr "" +msgstr "Comando Print" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" -msgstr "" +msgstr "Diretório: `tests/statements/print`" #: ../../doc/src/progress.md msgid "`Basic print`" -msgstr "" +msgstr "`print básico`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/print/t01.f90)" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" @@ -4182,392 +4369,543 @@ msgstr "" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" -msgstr "" +msgstr "Diretório: `tests/statements/file_io`" #: ../../doc/src/progress.md +#, fuzzy msgid "`open/read/write/close`" -msgstr "" +msgstr "`open/read/write/close`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/file_io/t01.f90)" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" -msgstr "" +msgstr "Funções Intrínsecas" #: ../../doc/src/progress.md:199 msgid "abs" -msgstr "" +msgstr "abs" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/abs`" #: ../../doc/src/progress.md msgid "`scalar single/double real`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" msgstr "" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t03_array1d_real.f90)" #: ../../doc/src/progress.md:210 msgid "exp" -msgstr "" +msgstr "exp" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/exp`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t03_array1d_real.f90)" #: ../../doc/src/progress.md:221 msgid "log" -msgstr "" +msgstr "log" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/log`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t03_array1d_real.f90)" #: ../../doc/src/progress.md:232 msgid "sqrt" -msgstr "" +msgstr "sqrt" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/sqrt`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t03_array1d_real.f90)" #: ../../doc/src/progress.md:243 msgid "sin" -msgstr "" +msgstr "sin" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/sin`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t03_array1d_real.f90)" #: ../../doc/src/progress.md:254 msgid "cos" -msgstr "" +msgstr "cos" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/cos`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t03_array1d_real.f90)" #: ../../doc/src/progress.md:265 msgid "tan" -msgstr "" +msgstr "tan" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/tan`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t03_array1d_real.f90)" #: ../../doc/src/progress.md:276 msgid "sinh" -msgstr "" +msgstr "sinh" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/sinh`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:287 msgid "cosh" -msgstr "" +msgstr "cosh" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/cosh`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:298 msgid "tanh" -msgstr "" +msgstr "tanh" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/tanh`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:309 msgid "asin" -msgstr "" +msgstr "asin" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/asin`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t03_array1d_real.f90)" #: ../../doc/src/progress.md:320 msgid "acos" -msgstr "" +msgstr "acos" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/acos`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t03_array1d_real.f90)" #: ../../doc/src/progress.md:331 msgid "atan" -msgstr "" +msgstr "atan" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/atan`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t02_scalar_complex.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t03_array1d_real.f90)" #: ../../doc/src/progress.md:342 msgid "modulo" -msgstr "" +msgstr "modulo" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/modulo`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/modulo/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/modulo/t03_array1d_real.f90)" #: ../../doc/src/progress.md:352 msgid "mod" -msgstr "" +msgstr "mod" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/mod`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/mod/t01_scalar_real.f90)" #: ../../doc/src/progress.md +#, fuzzy msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/mod/t03_array1d_real.f90)" #: ../../doc/src/progress.md:362 msgid "min" -msgstr "" +msgstr "min" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/min`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/min/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/min/t01_scalar_real.f90)" #: ../../doc/src/progress.md:371 msgid "max" -msgstr "" +msgstr "max" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/max`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/max/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/max/t01_scalar_real.f90)" #: ../../doc/src/progress.md:380 msgid "int" -msgstr "" +msgstr "int" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/int`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/int/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/int/t01_scalar_real.f90)" #: ../../doc/src/progress.md:389 msgid "real" -msgstr "" +msgstr "real" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/real`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/real/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/real/t01_scalar_real.f90)" #: ../../doc/src/progress.md:398 msgid "floor" -msgstr "" +msgstr "floor" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/floor`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/floor/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/floor/t01_scalar_real.f90)" #: ../../doc/src/progress.md:407 msgid "nint" -msgstr "" +msgstr "nint" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" -msgstr "" +msgstr "Diretório: `tests/intrinsic/nint`" #: ../../doc/src/progress.md +#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/nint/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/nint/t01_scalar_real.f90)" diff --git a/doc/locale/zh_CN/LC_MESSAGES/docs.po b/doc/locale/zh_CN/LC_MESSAGES/docs.po index e8aa7b3152..6d15657141 100644 --- a/doc/locale/zh_CN/LC_MESSAGES/docs.po +++ b/doc/locale/zh_CN/LC_MESSAGES/docs.po @@ -8,8 +8,8 @@ msgstr "" "Project-Id-Version: LFortran\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2022-08-18 00:30+0200\n" -"PO-Revision-Date: 2022-08-22 11:19+0000\n" -"Last-Translator: St Maxwell \n" +"PO-Revision-Date: 2022-09-01 08:03+0000\n" +"Last-Translator: 左志华 \n" "Language-Team: Chinese (Simplified) \n" "Language: zh_CN\n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" -"X-Generator: Weblate 4.14-dev\n" +"X-Generator: Weblate 4.14.1-dev\n" "Generated-By: Babel 2.10.3\n" #: ../../doc/src/ast_and_asr.ipynb:9 @@ -75,7 +75,6 @@ msgid "" msgstr "AST 必须代表所有的 ``use`` 语句和 ``interface`` 块,并保持语义一致。" #: ../../doc/src/ast_and_asr.ipynb:162 -#, fuzzy msgid "" "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" @@ -103,8 +102,8 @@ msgid "" " do, it is not complicated. We will help you with any technical issues " "and help improve your contribution so that it can be merged." msgstr "" -"我们欢迎任何人的贡献,即使您是开源新手。起初为编译器做贡献可能听起来令人生畏" -",但可以尝试去做,这并不复杂。我们将帮助您解决任何技术问题并帮助改进您的贡献" +"我们欢迎任何人的贡献,即使你是开源新手。起初为编译器做贡献可能听起来令人生畏" +",但可以尝试去做,这并不复杂。我们将帮助你解决任何技术问题并帮助改进你的贡献" ",以便将其合并。" #: ../../doc/src/contributing.md:8 @@ -113,11 +112,11 @@ msgstr "基本设置" #: ../../doc/src/contributing.md:10 msgid "To contribute, make sure your set up:" -msgstr "要做出贡献,请确保您的设置:" +msgstr "要做出贡献,请确保你的设置:" #: ../../doc/src/contributing.md:12 msgid "Your username + email" -msgstr "您的用户名 + 电子邮件" +msgstr "你的用户名 + 电子邮件" #: ../../doc/src/contributing.md:13 msgid "Your `~/.gitconfig`" @@ -125,7 +124,7 @@ msgstr "你的 `~/.gitconfig`" #: ../../doc/src/contributing.md:14 msgid "Your shell prompt to display the current branch name" -msgstr "您的 shell 提示显示当前分支名称" +msgstr "你的 shell 提示显示当前分支名称" #: ../../doc/src/contributing.md:16 msgid "Fork LFortran" @@ -142,14 +141,14 @@ msgid "" "Step 2. Set up your [SSH key](https://docs.github.com/en/authentication" "/connecting-to-github-with-ssh) with GitHub" msgstr "" -"步骤 2. 使用 GitHub 设置您的 [SSH 密钥](https://docs.github.com/en/" +"步骤 2. 使用 GitHub 设置你的 [SSH 密钥](https://docs.github.com/en/" "authentication/connecting-to-github-with-ssh)" #: ../../doc/src/contributing.md:22 msgid "" "Step 3. Clone the project repository from GitHub and set up your remote " "repository" -msgstr "步骤 3. 从 GitHub 克隆项目存储库并设置您的远程存储库" +msgstr "步骤 3. 从 GitHub 克隆项目存储库并设置你的远程存储库" #: ../../doc/src/contributing.md:29 msgid "" @@ -163,14 +162,14 @@ msgid "" ":fontawesome-solid-edit: `YOUR_GITHUB_ID` is your user ID on GitHub and " "should be part of your account path." msgstr "" -":fontawesome-solid-edit: `YOUR_GITHUB_ID` 是您在 GitHub 上的用户 " -"ID,应该是您帐户路径的一部分。" +":fontawesome-solid-edit: `YOUR_GITHUB_ID` 是你在 GitHub 上的用户 " +"ID,应该是你帐户路径的一部分。" #: ../../doc/src/contributing.md:33 msgid "" "You can use `git remote -v` to check if the new remote is set up " "correctly." -msgstr "您可以使用 `git remote -v` 检查新远程地址是否设置正确。" +msgstr "你可以使用 `git remote -v` 检查新远程地址是否设置正确。" #: ../../doc/src/contributing.md:35 msgid "Send a New Merge Request" @@ -197,7 +196,7 @@ msgstr "[这里](https://chris.beams.io/posts/git-commit/) " #: ../../doc/src/contributing.md:53 msgid "Step 4. Check to ensure that your changes look good" -msgstr "第 4 步:检查以确保您的更改看起来不错" +msgstr "第 4 步:检查以确保你的更改看起来不错" #: ../../doc/src/contributing.md:58 msgid "Step 5. Send the merge request" @@ -212,7 +211,7 @@ msgid "" " the \"Create\" button. Yay you are now all set." msgstr "" "该命令会将新分支 `fix1` 推送到您之前创建的远程存储库 `REMOTE_NAME` 中。此外," -"它还将显示一个链接,您可以单击该链接以打开新的合并请求。单击链接后,写下标题" +"它还将显示一个链接,你可以单击该链接以打开新的合并请求。单击链接后,写下标题" "和简明描述,然后单击 `创建` 按钮。是的,你现在一切就绪。" #: ../../doc/src/contributing.md:66 @@ -369,7 +368,7 @@ msgid "" "[mailinglist](https://groups.io/g/lfortran) or a " "[chat](https://lfortran.zulipchat.com/)." msgstr "" -"如果您有任何问题或需要帮助,请通过我们的 [mailinglist](https://groups.io/g/" +"如果你有任何问题或需要帮助,请通过我们的 [mailinglist](https://groups.io/g/" "lfortran) 或 [chat](https://lfortran.zulipchat.com/) 提问。" #: ../../doc/src/contributing.md:248 @@ -379,7 +378,7 @@ msgid "" "by its terms. See " "[CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/blob/main/CODE_OF_CONDUCT.md)." msgstr "" -"请注意,该项目的所有参与者都应遵守我们的行为准则。参与本项目即表示您同意遵守" +"请注意,该项目的所有参与者都应遵守我们的行为准则。参与本项目即表示你同意遵守" "其条款。请参阅 [CODE_OF_CONDUCT.md](https://github.com/lfortran/lfortran/" "blob/main/CODE_OF_CONDUCT.md)。" @@ -390,8 +389,8 @@ msgid "" "[license](https://github.com/lfortran/lfortran/blob/main/LICENSE) unless " "explicitly noted otherwise." msgstr "" -"通过提交 PR,您同意根据 LFortran 的 BSD [许可](https://github.com/lfortran/" -"lfortran/blob/main/LICENSE) 许可您的贡献,除非另有明确说明。" +"通过提交 PR,你同意根据 LFortran 的 BSD [许可](https://github.com/lfortran/" +"lfortran/blob/main/LICENSE) 许可你的贡献,除非另有明确说明。" #: ../../doc/src/design.md:1 msgid "LFortran Design" @@ -629,7 +628,7 @@ msgstr "" "变量,如果这是一个接口,则需要指定在哪里可以找到实现,否则为body 提供了语句," "这些节点与 AST 中的几乎相同,除了每个变量只是对符号表中的符号的引用(因此通过" "构造一个不能有未定义的变量)。每个节点(例如 Function 或 " -"Module)的符号表也引用其父节点(例如,函数引用模块,模块引用全局范围)。" +"Module)的符号表也引用其父节点(例如,函数引用模块,模块引用全局作用域)。" #: ../../doc/src/design.md:102 msgid "" @@ -693,9 +692,9 @@ msgid "" "statements, declarations, use statements and expressions. We define " "_global scope_ as a collection of the following items:" msgstr "" -"我们通过引入_全局范围_来扩展 Fortran 语言,它不仅是_程序单元_列表(如 F2008 " -"中),还可以包括语句、声明、使用语句和表达式。我们将_全局范围_定义为以下项目" -"的集合:" +"我们通过引入_全局作用域_来扩展 Fortran 语言,它不仅是_程序单元_列表(如 " +"F2008 中),还可以包括语句、声明、使用语句和表达式。我们将_全局作用域_定义为" +"以下项目的集合:" #: ../../doc/src/design.md:134 msgid "use statement" @@ -724,7 +723,7 @@ msgid "" msgstr "" "此外,如果变量没有在赋值语句中定义(例如`x = " "5+3`),则从右侧推断变量的类型(例如,`x` in `x = 5+3 ` 将是 `integer` 类型," -"而 `y = 5._dp` 中的 `y` 将是 `real(dp)` 类型)。此规则仅适用于 _全局范围_ " +"而 `y = 5._dp` 中的 `y` 将是 `real(dp)` 类型)。此规则仅适用于 _全局作用域_ " "的顶层。类型必须在主程序、模块、函数和子程序中完全指定,就像在 F2008 中一样。" #: ../../doc/src/design.md:146 @@ -734,14 +733,14 @@ msgid "" "functions, subroutines, statements and expressions at the top level of " "_global scope_ use and operate on this symbol table." msgstr "" -"_全局范围_ 有自己的符号表。主程序和模块/子模块看不到此符号表中的任何符号。但" -"是_全局范围_顶层的函数、子例程、语句和表达式使用和操作这个符号表。" +"_全局作用域_ 有自己的符号表。主程序和模块/子模块看不到此符号表中的任何符号。" +"但是_全局作用域_顶层的函数、子例程、语句和表达式使用和操作这个符号表。" #: ../../doc/src/design.md:151 msgid "" "The _global scope_ has the following symbols predefined in the symbol " "table:" -msgstr "_全局范围_ 在符号表中预定义了以下符号:" +msgstr "_全局作用域_ 在符号表中预定义了以下符号:" #: ../../doc/src/design.md:153 msgid "" @@ -919,7 +918,7 @@ msgstr "开发者指南" #: ../../doc/src/index.md:156 msgid "LFortran Intrinsics" -msgstr "LFortran 内在函数" +msgstr "LFortran 内置函数" #: ../../doc/src/index.md:1 msgid "LFortran Documentation" @@ -948,10 +947,10 @@ msgid "" "[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb" "%2Flfortran-binder/master?filepath=Demo.ipynb)" msgstr "" -"网站:[https://lfortran.org/](https://lfortran.org/) " -"主存储库:[https://github.com/lfortran/lfortran](https://github.com/lfortran/" -"lfortran) 使用 Binder 在线尝试:[![Binder](https://mybinder.org/badge_logo." -"svg)](https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/" +"网站:[https://lfortran.org/](https://lfortran.org/" +");主存储库:[https://github.com/lfortran/lfortran](https://github.com/" +"lfortran/lfortran);使用 Binder 在线尝试:[![Binder](https://mybinder.org/" +"badge_logo.svg)](https://mybinder.org/v2/gl/lfortran%2Fweb%2Flfortran-binder/" "master?filepath=Demo.ipynb)" #: ../../doc/src/index.md:9 @@ -969,9 +968,9 @@ msgid "" "[Development Status](progress.md) section for more information on " "features being supported and being worked on." msgstr "" -"LFortran 正在开发中,有些功能现在可以使用,有些功能正在实现中。您还可以查看 [" +"LFortran 正在开发中,有些功能现在可以使用,有些功能正在实现中。你还可以查看 [" "Development Status](progress.md) " -"部分,了解有关受支持和正在开发的功能的更多信息。" +"部分,了解有关被支持和正在开发的功能的更多信息。" #: ../../doc/src/index.md:21 msgid "Works today" @@ -988,11 +987,11 @@ msgid "" "%2Flfortran-binder/master?filepath=Demo.ipynb) example notebook). Or " "it can be used from the command-line in an interactive prompt (REPL)." msgstr "" -"**交互式,Jupyter 支持** LFortran 可以从 Jupyter 用作 Fortran 内核,允许 " +"**交互式,Jupyter 支持**:LFortran 可以在 Jupyter 中用作 Fortran 内核,允许 " "Python/Julia 风格的快速原型设计和探索性工作流程(参见示例笔记: " -"[静态(https://nbviewer.jupyter.org/gist/certik/" -"f1d28a486510810d824869ab0c491b1c) 或 [交互](https://mybinder.org/v2/gl/" -"lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb)。或者," +"[静态](https://nbviewer.jupyter.org/gist/certik/" +"f1d28a486510810d824869ab0c491b1c) 或 [交互](https://mybinder.org/v2/gl/" +"lfortran%2Fweb%2Flfortran-binder/master?filepath=Demo.ipynb))。或者," "它可以在交互式提示 (REPL) 中的命令行中使用。" #: ../../doc/src/index.md:32 @@ -1004,7 +1003,7 @@ msgid "" "build tools on top. See the [Design](design.md) and [Developer " "Tutorial](developer_tutorial.md) documents for more details." msgstr "" -"**简洁、模块化设计,可用作库** LFortran 围绕两个独立模块 AST 和 ASR " +"**简洁、模块化设计,可用作库**:LFortran 围绕两个独立模块 AST 和 ASR " "构建,这两个模块都是独立的(完全独立于 LFortran 的其余部分),鼓励用户将它们" "独立用于其他应用程序并在上面构建工具。有关详细信息,请参阅 [Design](design." "md) 和 [Developer Tutorial](developer_tutorial.md) 文档。" @@ -1016,21 +1015,21 @@ msgid "" "with any Fortran compiler and linked with the original GFortran " "compiled module." msgstr "" -"**与 GFortran 的互操作** LFortran 可以将 GFortran 模块文件解析为 ASR " -"并生成一个 Fortran 包装器,该包装器可以用任何 Fortran 编译器编译并与原始 " +"**与 GFortran 的互操作**:LFortran 可以将 GFortran 模块文件解析为 ASR " +"并生成一个 Fortran 包装器,该包装器可以用任何 Fortran 编译器编译并与原 " "GFortran 编译模块链接。" #: ../../doc/src/index.md:44 msgid "" "**Create executables** It can create executables just like other " "Fortran compilers." -msgstr "**创建可执行文件** 它可以像其他 Fortran 编译器一样创建可执行文件。" +msgstr "**创建可执行文件**:它可以像其他 Fortran 编译器一样创建可执行文件。" #: ../../doc/src/index.md:47 msgid "" "**Runs on Linux, Mac and Windows** All three platforms are regularly " "tested by our CI." -msgstr "**在 Linux、Mac 和 Windows 上运行** 所有三个平台都由我们的 CI 定期测试。" +msgstr "**在 Linux、Mac 和 Windows 上运行**:所有三个平台都由我们的 CI 定期测试。" #: ../../doc/src/index.md:51 msgid "Planned" @@ -1040,7 +1039,7 @@ msgstr "计划" msgid "" "These features are under development, there is a link to the " "corresponding issue so that you can track the progress by following it." -msgstr "已计划这些功能正在开发中,有对应 issue 的链接,方便大家关注跟踪进度。" +msgstr "已计划这些功能正在开发中,有对应议题的链接,方便大家关注跟踪进度。" #: ../../doc/src/index.md:56 msgid "" @@ -1053,12 +1052,12 @@ msgid "" " planned, see [#56](https://gitlab.com/lfortran/lfortran/issues/56)), " "which allows to use LFortran with production codes today." msgstr "" -"**与其他语言(以及其他 Fortran 编译器)的原生互操作** 只需使用 `use` " +"**与其他语言(以及其他 Fortran 编译器)的原生互操作**:只需使用 `use` " "语句即可自动调用其他语言(如 C 或 Python)编写的代码,参见 " "[#44](https://gitlab.com/lfortran/lfortran/issues/44)。它理解其他 Fortran " "编译器模块文件(可以`use`它们)及其 ABI 以正确链接(支持 " -"GFortran,计划使用其他编译器,请参阅 [#56](https://gitlab.com/lfortran/" -"lfortran/问题/56)),它允许今天将 LFortran 与生产代码一起使用。" +"GFortran,计划使用其它编译器,请参阅 [#56](https://gitlab.com/lfortran/" +"lfortran/问题/56)),它允许将 LFortran 与如今的生产代码一起使用。" #: ../../doc/src/index.md:65 msgid "" @@ -1067,7 +1066,7 @@ msgid "" "constructs (such as `do concurrent`) to run on multi-core CPUs and " "GPUs, see [#57](https://gitlab.com/lfortran/lfortran/issues/57)." msgstr "" -"**现代硬件支持**感谢 LLVM,LFortran 的目标是在现代硬件上运行,并利用原生 " +"**现代硬件支持**:得益于 LLVM,LFortran 的目标是在现代硬件上运行,并利用原生 " "Fortran 语言结构(例如 `do concurrent`)在多核 CPU 和 GPU 上运行,请参阅 [# " "57](https://gitlab.com/lfortran/lfortran/issues/57)。" @@ -1078,7 +1077,7 @@ msgid "" "latest Fortran 2018 standard, see " "[#58](https://gitlab.com/lfortran/lfortran/issues/58)." msgstr "" -"**完整的 Fortran 2018 支持** 目前只实现了 Fortran 的一个子集," +"**完整的 Fortran 2018 支持**:目前只实现了 Fortran 的一个子集," "但目标是完整实现最新的 Fortran 2018 标准,请参阅 [#58](https://gitlab.com/" "lfortran/lfortran/issue/58)。" @@ -1088,7 +1087,7 @@ msgid "" "tracker](https://gitlab.com/lfortran/lfortran/issues) that you want us to" " prioritize (feel free to create new ones if we are missing anything)." msgstr "" -"请在我们的 [问题跟踪器](https://gitlab.com/lfortran/lfortran/issues) 中对您希" +"请在我们的 [议题跟踪器](https://gitlab.com/lfortran/lfortran/issues) 中对你希" "望我们优先考虑的问题进行投票(如果我们遗漏任何内容,请随时创建新问题)。" #: ../../doc/src/index.md:81 @@ -1157,14 +1156,15 @@ msgid "" "([#12](https://gitlab.com/lfortran/lfortran/issues/12)), and other ideas" " ([#29](https://gitlab.com/lfortran/lfortran/issues/29))." msgstr "" -"c) 实现所有其他很酷的功能:用于 C 和 Python 的 `use` 模块和自动包装器 " -"([#44](https://gitlab.com/lfortran/lfortran/issues/44)),现代硬件支持 ([# " -"57](https://gitlab.com/lfortran/lfortran/issues/57)),生成较旧的 Fortran " -"标准 ([#72](https://gitlab.com/lfortran/lfortran/issues/72)) , Fortran " -"doctest 功能 ([#73](https://gitlab.com/lfortran/lfortran/issues/73)), SymPy " -"集成 ([#71](https://gitlab.com/lfortran/lfortran/issues/71))、IDE 的语言服务 " -"([#12](https://gitlab.com/lfortran/lfortran/issues/12)) 和其他想法 " -"([#29](https://gitlab.com/lfortran/lfortran/issues/29))。" +"c) 实现所有其他很酷的功能:用于 C 和 Python 的 `use` " +"模块和自动包装器([#44](https://gitlab.com/lfortran/lfortran/issues/" +"44))、现代硬件支持([# 57](https://gitlab.com/lfortran/lfortran/issues/" +"57))、生成较旧的 Fortran 标准([#72](https://gitlab.com/lfortran/lfortran/" +"issues/72))、Fortran doctest 功能([#73](https://gitlab.com/lfortran/" +"lfortran/issues/73)), SymPy 集成([#71](https://gitlab.com/lfortran/" +"lfortran/issues/71))、IDE 的语言服务([#12](https://gitlab.com/lfortran/" +"lfortran/issues/12))和其他想法([#29](https://gitlab.com/lfortran/lfortran/" +"issues/29))。" #: ../../doc/src/index.md:118 msgid "The step 1. is an internal refactoring that will not take long." @@ -1184,10 +1184,10 @@ msgid "" "of summer 2019, hopefully sooner." msgstr "" "第 2 步将允许 LFortran 立即与生产代码交互使用(生产代码将使用 GFortran " -"编译,然后“使用”LFortran 中的任何模块,并且可以交互调用函数/子例程," -"模块本身可以使用任何GFortran 支持的功能,但 API 必须适合 LFortran 理解的子集 " -"--- 对于大量应用程序,带有数组参数的简单函数/子例程就足够了)。这将使 " -"LFortran 可供第一批用户使用,并且在 LFortran 支持给定功能之前," +"编译,然后“使用” LFortran 中的任何模块,并且可以交互调用函数/子例程," +"模块本身可以使用任何 GFortran 支持的功能,但 API 必须适合 LFortran " +"理解的子集 —— 对于大量应用程序,带有数组参数的简单函数/子例程就足够了)。" +"这将使 LFortran 可供第一批用户使用,并且在 LFortran 支持给定功能之前," "始终可以临时使用 GFortran。我们预计在 2019 年夏末完成第 2 步,希望能更快。" #: ../../doc/src/index.md:130 @@ -1204,7 +1204,7 @@ msgstr "安装" #: ../../doc/src/installation.md:3 msgid "All the instructions below work on Linux, macOS and Windows." -msgstr "以下所有说明都适用于 Linux、macOS 和 Windows。" +msgstr "以下所有说明适用于 Linux、macOS 和 Windows。" #: ../../doc/src/installation.md:5 msgid "Binaries" @@ -1219,7 +1219,7 @@ msgid "" "environment (you can choose any name, here we chose `lf`) and activate " "it:" msgstr "" -"安装 LFortran 的推荐方法是使用 Conda。例如,按照您的平台的说明安装 " +"安装 LFortran 的推荐方法是使用 Conda。例如,按照你的平台的说明安装 " "[Miniconda](https://conda.io/en/latest/miniconda.html),安装 " "Conda。然后创建一个新环境(你可以选择任何名称,这里我们选择了`lf`)并激活它:" @@ -1248,7 +1248,7 @@ msgstr "你可以通过执行以下命令来创建基于 Fortran 的 Jupyter 笔 #: ../../doc/src/installation.md:32 msgid "and selecting `New->Fortran`." -msgstr "并选择`New->Fortran`。" +msgstr "并选择 `New->Fortran`。" #: ../../doc/src/installation.md:35 msgid "Build From a Source Tarball" @@ -1314,15 +1314,13 @@ msgstr "克隆 LFortran git 存储库:" msgid "" "Generate files that are needed for the build (this step depends on " "`re2c`, `bison` and `python`):" -msgstr "" -"Generate files that are needed for the build (this step depends on `re2c`, " -"`bison` and `python`):" +msgstr "生成构建所需的文件(此步骤取决于 `re2c`、`bison` 和 `python`):" #: ../../doc/src/installation.md:86 msgid "" "Now the process is the same as installing from the source tarball. For " "example to build in Debug mode:" -msgstr "现在的过程与从源tarball安装相同。例如在Debug模式下构建:" +msgstr "现在的过程与从源 tarball 安装相同。例如在 Debug 模式下构建:" #: ../../doc/src/installation.md:92 msgid "Run tests:" @@ -1334,7 +1332,7 @@ msgstr "运行交互式提示符:" #: ../../doc/src/installation.md:102 msgid "Build from Git on Windows with Visual Studio" -msgstr "在Windows上使用Visual Studio从Git构建" +msgstr "在 Windows 上使用 Visual Studio 从 Git 构建" #: ../../doc/src/installation.md:104 msgid "" @@ -1342,8 +1340,8 @@ msgid "" "download the Community version for free from: " "https://visualstudio.microsoft.com/downloads/." msgstr "" -"安装Visual Studio (MSVC),例如2022版本,可以从: https://visualstudio." -"microsoft.com/downloads/ 免费下载社区版本。" +"安装 Visual Studio (MSVC),例如 2022 " +"版本,可以免费下载社区版本:https://visualstudio.microsoft.com/downloads/ 。" #: ../../doc/src/installation.md:107 msgid "" @@ -1354,17 +1352,16 @@ msgstr "" "miniforge。" #: ../../doc/src/installation.md:109 -#, fuzzy msgid "Launch the Miniforge Prompt from the Desktop." msgstr "从桌面上启动 Miniforge Prompt。" #: ../../doc/src/installation.md:111 msgid "In the shell, initialize the MSVC compiler using:" -msgstr "在shell中,用以下方法初始化MSVC编译器:" +msgstr "在 shell 中,用以下方法初始化 MSVC 编译器:" #: ../../doc/src/installation.md:117 msgid "You can optionally test that MSVC works by:" -msgstr "你可以选择通过以下方式测试MSVC是否工作:" +msgstr "你可以选择通过以下方式测试 MSVC 是否工作:" #: ../../doc/src/installation.md:122 msgid "Both commands must print help (several pages)." @@ -1372,11 +1369,11 @@ msgstr "这两个命令都必须打印帮助信息(若干页)。" #: ../../doc/src/installation.md:124 msgid "Now you can download and build LFortran:" -msgstr "现在你可以下载并建立LFortran:" +msgstr "现在你可以下载并建立 LFortran:" #: ../../doc/src/installation.md:134 msgid "If everything compiled, then you can use LFortran as follows:" -msgstr "如果一切都编译好了,那么你就可以使用LFortran,如下所示:" +msgstr "如果一切都编译好了,那么你就可以使用 LFortran,如下所示:" #: ../../doc/src/installation.md:140 msgid "And so on." @@ -1388,8 +1385,8 @@ msgid "" "is only available when the MSVC bat script above is ran. If you forget to" " activate it, LFortran's linking will fail." msgstr "" -"注意:LFortran目前使用MSVC的链接器程序(`link`),只有在运行上面的MSVC " -"bat脚本时才能使用。如果你忘记激活它,LFortran的链接就会失败。" +"注意:LFortran 目前使用 MSVC 的链接器程序(`link`),只有在运行上面的 MSVC " +"bat 脚本时才能使用。如果你忘记激活它,LFortran 的链接就会失败。" #: ../../doc/src/installation.md:146 msgid "" @@ -1399,30 +1396,30 @@ msgid "" "`vim`. For this reason the Conda build `environment_win.yml` contains " "everything needed, including `git`." msgstr "" -"注意:miniforge shell似乎在运行某个版本的`git-bash`(尽管它是`cmd.exe`),它" -"有一些类似unix的文件系统挂载在`/usr`,有几个命令可用,如`ls`、`which`、`git`" -"、`vim`。 由于这个原因,Conda构建的`environment_win." -"yml`包含了所有需要的东西,包括`git`。" +"注意:miniforge shell 似乎在运行某个版本的 `git-bash`(尽管它是`cmd.exe`)," +"它有一些类似 unix 的文件系统挂载在 " +"`/usr`,有几个命令可用,如`ls`、`which`、`git`、`vim`。 由于这个原因,Conda " +"构建的 `environment_win.yml` 包含了所有需要的东西,包括 `git`。" #: ../../doc/src/installation.md:152 msgid "Build from Git on Windows with WSL" -msgstr "用WSL在Windows上从Git构建" +msgstr "用 WSL 在 Windows上 从 Git 构建" #: ../../doc/src/installation.md:153 msgid "In windows search \"turn windows features on or off\"." -msgstr "在windows中搜索 \"打开或关闭windows功能\"。" +msgstr "在 Windows 中搜索“打开或关闭 Windows 功能”。" #: ../../doc/src/installation.md:154 msgid "Tick Windows subsystem for Linux." -msgstr "标记Linux的Windows子系统。" +msgstr "标记适用于Linux 的 Windows 子系统。" #: ../../doc/src/installation.md:155 msgid "Press OK and restart computer." -msgstr "按 \"确定 \"并重新启动计算机。" +msgstr "按“确定”并重新启动计算机。" #: ../../doc/src/installation.md:156 msgid "Go to Microsoft store and download Ubuntu 20.04, and launch it." -msgstr "到微软商店下载Ubuntu 20.04,并启动它。" +msgstr "到微软商店下载 Ubuntu 20.04,并启动它。" #: ../../doc/src/installation.md:157 msgid "Run the following commands." @@ -1438,11 +1435,11 @@ msgstr "然后转到文件底部,粘贴以下内容" #: ../../doc/src/installation.md:172 msgid "Then press ctrl + O (save), Enter (confirm), ctrl + X (exit)" -msgstr "然后按ctrl + O(保存),Enter(确认),ctrl + X(退出)" +msgstr "然后按 ctrl + O(保存),Enter(确认),ctrl + X(退出)" #: ../../doc/src/installation.md:173 msgid "After that restart Ubuntu" -msgstr "之后,重新启动Ubuntu" +msgstr "之后,重新启动 Ubuntu" #: ../../doc/src/installation.md:174 msgid "Run the following" @@ -1450,13 +1447,14 @@ msgstr "运行以下内容" #: ../../doc/src/installation.md:179 msgid "Restart Ubuntu again" -msgstr "再次重启Ubuntu" +msgstr "再次重启 Ubuntu" #: ../../doc/src/installation.md:187 msgid "" "You can change the directory to a Windows location using `cd /mnt/[drive " "letter]/[windows location]`." -msgstr "你可以使用 `cd /mnt/[drive letter]/[windows location]`将目录改为Windows位置。" +msgstr "你可以使用 `cd /mnt/[drive letter]/[windows location]`将路径改为 Windows " +"位置。" #: ../../doc/src/installation.md:188 msgid "e.g. `cd mnt/c/Users/name/source/repos/`" @@ -1464,7 +1462,7 @@ msgstr "例如:`cd mnt/c/Users/name/source/repos/`" #: ../../doc/src/installation.md:190 msgid "Now clone the LFortran git repository" -msgstr "现在克隆LFortran的git仓库" +msgstr "现在克隆 LFortran 的 git 仓库" #: ../../doc/src/installation.md:196 msgid "Run the following commands" @@ -1472,7 +1470,7 @@ msgstr "运行以下命令" #: ../../doc/src/installation.md:204 msgid "If everything compiles, you can use LFortran as follows" -msgstr "如果一切都能编译,你可以使用LFortran,如下所示" +msgstr "如果一切都能编译,你可以使用 LFortran,如下所示" #: ../../doc/src/installation.md:210 msgid "Run an interactive prompt" @@ -1484,35 +1482,36 @@ msgstr "运行测试" #: ../../doc/src/installation.md:221 msgid "Enabling the Jupyter Kernel" -msgstr "启用Jupyter内核" +msgstr "启用 Jupyter 内核" #: ../../doc/src/installation.md:223 msgid "To install the Jupyter kernel, install the following Conda packages also:" -msgstr "要安装Jupyter内核,还要安装以下Conda软件包:" +msgstr "要安装 Jupyter 内核,还要安装以下 Conda 软件包:" #: ../../doc/src/installation.md:227 msgid "" "and enable the kernel by `-DWITH_XEUS=yes` and install into " "`$CONDA_PREFIX`. For example:" -msgstr "并通过`-DWITH_XEUS=yes`启用内核,然后安装到`$CONDA_PREFIX`。比如说:" +msgstr "并通过 `-DWITH_XEUS=yes` 启用内核,然后安装到 `$CONDA_PREFIX`。比如:" #: ../../doc/src/installation.md:239 msgid "" "To use it, install Jupyter (`conda install jupyter`) and test that the " "LFortran kernel was found:" -msgstr "要使用它,请安装Jupyter(`conda install jupyter`)并测试是否找到LFortran内核:" +msgstr "要使用它,请安装 Jupyter(`conda install jupyter`)并测试是否找到 LFortran " +"内核:" #: ../../doc/src/installation.md:244 msgid "Then launch a Jupyter notebook as follows:" -msgstr "然后启动Jupyter notebook,如下所示:" +msgstr "然后启动 Jupyter notebook,如下所示:" #: ../../doc/src/installation.md:248 msgid "Click `New->Fortran`. To launch a terminal jupyter LFortran console:" -msgstr "单击`新的- > Fortran`。启动jupyter LFortran终端控制台:" +msgstr "单击 `New - > Fortran`。启动 jupyter LFortran 终端控制台:" #: ../../doc/src/installation.md:254 msgid "Build From Git with Nix" -msgstr "使用Nix从Git构建" +msgstr "使用 Nix 从 Git 构建" #: ../../doc/src/installation.md:256 msgid "" @@ -1521,8 +1520,9 @@ msgid "" "the development environment. If you want, you can report bugs in a `nix-" "shell` environment to make it easier for others to reproduce." msgstr "" -"确保精确环境和依赖关系的方法之一是使用`nix`。这将确保系统的依赖性不会干扰到开" -"发环境。如果你愿意,你可以在`nix-shell`环境下报告bug,以方便别人复制。" +"确保精确环境和依赖关系的方法之一是使用 " +"`nix`。这将确保系统的依赖性不会干扰到开发环境。如果你愿意,你可以在 `nix-" +"shell` 环境下报告 bug,以方便别人复制。" #: ../../doc/src/installation.md:258 msgid "With Root" @@ -1533,8 +1533,8 @@ msgid "" "We start by getting `nix`. The following multi-user installation will " "work on any machine with a Linux distribution, MacOS or Windows (via " "WSL):" -msgstr "我们从获得`nix`开始。下面的多用户安装将在任何装有Linux发行版、MacOS或Windows" -"(通过WSL)的机器上工作:" +msgstr "我们从获得 `nix` 开始。下面的多用户安装将在任何装有 Linux 发行版、MacOS 或 " +"Windows(通过 WSL)的机器上工作:" #: ../../doc/src/installation.md:264 msgid "Without Root" @@ -1546,8 +1546,8 @@ msgid "" "on Linux distributions we can use [nix-" "portable](https://github.com/DavHau/nix-portable)." msgstr "" -"如果你想不给`nix`提供机器的root权限,在Linux发行版上,我们可以使用[nix-" -"portable] (https://github.com/DavHau/nix-portable)。" +"如果你想不给`nix`提供机器的root权限,在Linux发行版上,我们可以使用 [nix-" +"portable](https://github.com/DavHau/nix-portable).。" #: ../../doc/src/installation.md:270 msgid "" @@ -1568,17 +1568,17 @@ msgstr "现在进入开发环境:" msgid "" "The `--pure` flag ensures no system dependencies are used in the " "environment." -msgstr "`--pure`标志确保在环境中不使用系统依赖。" +msgstr "`--pure` 标志确保在环境中不使用系统依赖。" #: ../../doc/src/installation.md:286 msgid "The build steps are the same as with the `ci`:" -msgstr "构建步骤与 `ci `相同:" +msgstr "构建步骤与 `ci ` 相同:" #: ../../doc/src/installation.md:292 msgid "" "To change the compilation environment from `gcc` (default) to `clang` we " "can use `--argstr`:" -msgstr "要把编译环境从`gcc`(默认)改为`clang`,我们可以使用`--argstr`:" +msgstr "要把编译环境从 `gcc`(默认)改为 `clang`,我们可以使用 `--argstr`:" #: ../../doc/src/installation.md:297 msgid "Note About Dependencies" @@ -1590,8 +1590,9 @@ msgid "" "[https://lfortran.org/download/](https://lfortran.org/download/), which " "only depends on LLVM, CMake and a C++ compiler." msgstr "" -"我们鼓励终端用户(和发行版)使用来自 [https://lfortran.org/download/] " -"(https://lfortran.org/download/)的tarball,它只依赖于LLVM、CMake和C++编译器。" +"我们鼓励终端用户(和发行版)使用来自 [https://lfortran.org/download/" +"](https://lfortran.org/download/" +")的tarball,它只依赖于LLVM、CMake和C++编译器。" #: ../../doc/src/installation.md:303 msgid "" @@ -1599,31 +1600,29 @@ msgid "" " and contains some autogenerated files: the parser, the AST and ASR " "nodes, which is generated by an ASDL translator (requires Python)." msgstr "" -"这个tarball是由我们的CI(持续集成)自动生成的,包含一些自动生成的文件:解析器" -"、AST和ASR节点,由ASDL翻译器生成(需要Python)。" +"这个 tarball 是由我们的 " +"CI(持续集成)自动生成的,包含一些自动生成的文件:解析器、AST 和 ASR 节点," +"由 ASDL 翻译器生成(需要 Python)。" #: ../../doc/src/installation.md:307 msgid "The instructions from git are to be used when developing LFortran itself." -msgstr "在开发LFortran本身时要使用来自git的指令。" +msgstr "在开发 LFortran 本身时要使用来自 git 的指令。" #: ../../doc/src/installation.md:309 msgid "Note for users who do not use Conda" -msgstr "不使用Conda的用户注意" +msgstr "不使用 Conda 的用户注意" #: ../../doc/src/installation.md:311 -#, fuzzy msgid "" "Following are the dependencies necessary for installing this repository " "in development mode," -msgstr "以下是在开发模式下安装此版本库的必要依赖," +msgstr "以下是在开发模式下安装此版本库的必要依赖," #: ../../doc/src/installation.md:314 -#, fuzzy msgid "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" msgstr "[Bison - 3.5.1](https://ftp.gnu.org/gnu/bison/bison-3.5.1.tar.xz)" #: ../../doc/src/installation.md:315 -#, fuzzy msgid "" "[LLVM - 11.0.1](https://github.com/llvm/llvm-" "project/releases/download/llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" @@ -1632,7 +1631,6 @@ msgstr "" "llvmorg-11.0.1/llvm-11.0.1.src.tar.xz)" #: ../../doc/src/installation.md:316 -#, fuzzy msgid "[re2c - 2.0.3](https://re2c.org/install/install.html)" msgstr "[re2c - 2.0.3](https://re2c.org/install/install.html)" @@ -1644,8 +1642,8 @@ msgid "" "dependency to build the dynamic libraries (the ones ending with `.so`)." msgstr "" "[binutils - 2.31.90](ftp://sourceware.org/pub/binutils/snapshots/binutils-2." -"31.90.tar.xz) - 确保你应该启用与此依赖关系相关的必要选项来构建动态库(以`." -"so`结尾的库)。" +"31.90.tar.xz) —— 确保你应该启用与此依赖关系相关的必要选项来构建动态库(以 `." +"so` 结尾的库)。" #: ../../doc/src/installation.md:319 msgid "Stacktraces" @@ -1662,21 +1660,19 @@ msgid "" "instructions below." msgstr "" "LFortran 可以在出现未处理的异常时打印堆栈跟踪,也可以在任何编译器错误时使用 " -"`--show-stacktrace` 选项。这对开发编译器本身很有帮助,可以看到LFortran中的问" -"题所在。默认情况下,堆栈跟踪支持是关闭的,要启用它,需要在每个平台上按照下面" -"的说明安装先决条件后,用`-DWITH_STACKTRACE=yes` cmake选项编译LFortran。" +"`--show-stacktrace` 选项。这对开发编译器本身很有帮助,可以看到 LFortran 中的" +"问题所在。默认情况下,堆栈跟踪支持是关闭的,要启用它,需要在每个平台上按照下" +"面的说明安装先决条件后,用`-DWITH_STACKTRACE=yes` cmake 选项编译 LFortran。" #: ../../doc/src/installation.md:328 -#, fuzzy msgid "Ubuntu" msgstr "Ubuntu" #: ../../doc/src/installation.md:330 msgid "In Ubuntu, `apt install binutils-dev`." -msgstr "在Ubuntu系统, `apt install binutils-dev`." +msgstr "在 Ubuntu 系统,`apt install binutils-dev`。" #: ../../doc/src/installation.md:332 -#, fuzzy msgid "macOS" msgstr "macOS" @@ -1688,23 +1684,24 @@ msgid "" "store the debug information, see `src/bin/CMakeLists.txt` for more " "details). If it does not work, please report a bug." msgstr "" -"如果你在macOS上使用默认的Clang编译器,那么堆栈跟踪应该正好在基于Intel和M1的ma" -"cOS上工作(CMake构建系统自动调用`dsymtuil`工具和我们的Python脚本来存储调试信" -"息,更多细节见`src/bin/CMakeLists.txt`)。如果不能工作,请报告一个错误。" +"如果你在 macOS 上使用默认的 Clang 编译器,那么堆栈跟踪应该正好在基于 Intel " +"和 M1 的 macOS 上工作(CMake 构建系统自动调用 `dsymtuil` 工具和我们的 Python " +"脚本来存储调试信息,更多细节见 `src/bin/CMakeLists." +"txt`)。如果不能工作,请报告一个错误。" #: ../../doc/src/installation.md:340 msgid "" "If you do not like the default way, an alternative is to use bintutils. " "For that, first install [Spack](https://spack.io/), then:" -msgstr "如果你不喜欢默认的方式,另一个选择是使用bintutils。为此,首先安装[Spack](http" -"s://spack.io/),然后:" +msgstr "如果你不喜欢默认的方式,另一个选择是使用bintutils。为此,首先安装 " +"[Spack](https://spack.io/),然后:" #: ../../doc/src/installation.md:347 msgid "" "The last command will show a full path to the installed `binutils` " "package. Add this path to your shell config file, e.g.:" -msgstr "最后一条命令将显示已安装的`binutils`软件包的完整路径。把这个路径添加到你的she" -"ll配置文件中,例如:" +msgstr "最后一条命令将显示已安装的 `binutils` 软件包的完整路径。把这个路径添加到你的 " +"shell 配置文件中,例如:" #: ../../doc/src/installation.md:352 msgid "" @@ -1713,17 +1710,17 @@ msgid "" " option. The `$CONDA_PREFIX` is there if you install some other " "dependencies (such as `llvm`) using Conda, otherwise you can remove it." msgstr "" -"并使用`-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` cma" -"ke选项编译LFortran。`$CONDA_PREFIX`是在你使用Conda安装了一些其他的依赖项(如`" -"llvm`)的情况下出现的,否则你可以把它删除。" +"并使用 `-DCMAKE_PREFIX_PATH=\"$CMAKE_PREFIX_PATH_LFORTRAN;$CONDA_PREFIX\"` " +"cmake 选项编译 LFortran。`$CONDA_PREFIX` 是在你使用 Conda " +"安装了一些其他的依赖项(如 `llvm`)的情况下出现的,否则你可以把它删除。" #: ../../doc/src/intrinsics/array.md:1 msgid "Array Intrinsic Functions" -msgstr "数组内在函数" +msgstr "数组内置函数" #: ../../doc/src/intrinsics/array/allocated.md:1 msgid "allocated(x): Status Check" -msgstr "已分配(x):状态检查" +msgstr "allocated(x):状态检查" #: ../../doc/src/intrinsics/array/allocated.md:3 msgid "Logical status of an allocatable integer." @@ -1821,7 +1818,7 @@ msgstr "声明" #: ../../doc/src/intrinsics/numeric/gamma.md:7 #: ../../doc/src/intrinsics/numeric/mod.md:7 msgid "Syntax" -msgstr "句法" +msgstr "语法" #: ../../doc/src/intrinsics/array/allocated.md:14 #: ../../doc/src/intrinsics/array/cshift.md:14 @@ -1870,7 +1867,7 @@ msgstr "句法" #: ../../doc/src/intrinsics/numeric/gamma.md:14 #: ../../doc/src/intrinsics/numeric/mod.md:15 msgid "Arguments" -msgstr "论据" +msgstr "参数" #: ../../doc/src/intrinsics/array/allocated.md:16 msgid "`x` is an integer input parameter." @@ -2030,14 +2027,14 @@ msgstr "`allocated(x)` 检查整数输入参数的分配状态。 " #: ../../doc/src/intrinsics/numeric/gamma.md:38 #: ../../doc/src/intrinsics/numeric/mod.md:43 msgid "Types" -msgstr "" +msgstr "类型" #: ../../doc/src/intrinsics/array/allocated.md:31 #: ../../doc/src/intrinsics/array/size.md:35 #: ../../doc/src/intrinsics/character/achar.md:39 #: ../../doc/src/intrinsics/character/char.md:40 msgid "Supported argument type is integer." -msgstr "" +msgstr "支持的参数类型是整型。" #: ../../doc/src/intrinsics/array/allocated.md:46 #: ../../doc/src/intrinsics/array/cshift.md:43 @@ -2086,7 +2083,7 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:58 #: ../../doc/src/intrinsics/numeric/mod.md:80 msgid "Examples" -msgstr "" +msgstr "示例" #: ../../doc/src/intrinsics/array/allocated.md:59 #: ../../doc/src/intrinsics/array/cshift.md:55 @@ -2100,7 +2097,7 @@ msgstr "" #: ../../doc/src/intrinsics/mathematical/atanh.md:77 #: ../../doc/src/intrinsics/mathematical/fraction.md:44 msgid "**Result**:" -msgstr "" +msgstr "**结果**:" #: ../../doc/src/intrinsics/array/allocated.md:65 #: ../../doc/src/intrinsics/array/cshift.md:62 @@ -2153,32 +2150,32 @@ msgstr "也可以看看" #: ../../doc/src/intrinsics/array/cshift.md:1 msgid "cshift(A, shift [, dim]): Circular Shift" -msgstr "" +msgstr "cshift(A, shift [, dim]):循环移位" #: ../../doc/src/intrinsics/array/cshift.md:3 msgid "Circular shift elements of an array." -msgstr "" +msgstr "数组元素的循环移位。" #: ../../doc/src/intrinsics/array/cshift.md:16 #: ../../doc/src/intrinsics/array/size.md:16 msgid "`A` the input array of any type or rank." -msgstr "" +msgstr "`A` 为任何类型或维度的输入数组。" #: ../../doc/src/intrinsics/array/cshift.md:18 msgid "`shift` the input value of integer type." -msgstr "" +msgstr "`shift` 为整型类型的输入值。" #: ../../doc/src/intrinsics/array/cshift.md:20 msgid "" "`dim` optional dimension, if present, `cshift` returns the result of this" " dimension." -msgstr "" +msgstr "`dim` 可选维度,如果存在,`cshift` 返回此维度的结果。" #: ../../doc/src/intrinsics/array/cshift.md:24 msgid "" "The return value is of input array type and rank as the `A` array input " "argument." -msgstr "" +msgstr "返回值与数组输入参数 `A` 的类型与维度相同。" #: ../../doc/src/intrinsics/array/cshift.md:28 msgid "" @@ -2186,47 +2183,50 @@ msgid "" " array along the dimension of `dim`. Default value of `dim` is 1, used " "when `dim` is not passed." msgstr "" +"**cshift(A, shift [, dim])** 沿 `dim` 的维度对 `A` 数组的元素执行循环移位。" +"当 `dim` 未传递时使用,`dim` 的默认值为 1。" #: ../../doc/src/intrinsics/array/cshift.md:32 msgid "" "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." -msgstr "" +msgstr "如果数组的维度数为 1,则数组的所有元素都会移动 `shift` 位。如果维度数大于 " +"1,则沿给定维度的数组元素都被移动。" #: ../../doc/src/intrinsics/array/cshift.md:36 msgid "" "Elements shifted out one end of each rank one section are shifted back in" " the other end." -msgstr "" +msgstr "元素从每一列的一端移出,在另一端移回。" #: ../../doc/src/intrinsics/array/cshift.md:41 msgid "" "Supported argument type is array for `A` and integer for `shift` and " "`dim`." -msgstr "" +msgstr "支持的参数类型是 `A` 的数组和 `shift` 和 `dim` 的整数。" #: ../../doc/src/intrinsics/array/size.md:1 msgid "size(x): Size of Array" -msgstr "" +msgstr "size(x):数组大小" #: ../../doc/src/intrinsics/array/size.md:3 msgid "Returns the size of an array `x`." -msgstr "" +msgstr "返回数组 `x` 的大小。" #: ../../doc/src/intrinsics/array/size.md:18 msgid "" "`dim` optional dimension, if present, `size` returns the size of this " "dimension." -msgstr "" +msgstr "`dim` 可选维度,如果存在,`size` 返回此维度的大小。" #: ../../doc/src/intrinsics/array/size.md:20 msgid "`kind` optional the kind of the return value." -msgstr "" +msgstr "`kind` 可选返回值的种类。" #: ../../doc/src/intrinsics/array/size.md:24 msgid "`n` the size of an array (integer)." -msgstr "" +msgstr "`n` 数组的大小(整型)。" #: ../../doc/src/intrinsics/array/size.md:28 msgid "" @@ -2235,42 +2235,45 @@ msgid "" " 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." msgstr "" +"`size` 内部函数返回数组的大小。它返回所有维度的乘积,除非指定了 `dim` " +"参数,在这种情况下,它只返回这个特定维度的大小。 `kind` " +"参数可用于指定结果的整数类型。" #: ../../doc/src/intrinsics/array/size.md:57 msgid "[shape](), [reshape]()." -msgstr "" +msgstr "[shape](),[reshape]()。" #: ../../doc/src/intrinsics/bit.md:1 msgid "Bit Intrinsic Functions" -msgstr "" +msgstr "位操作内置函数" #: ../../doc/src/intrinsics/bit/bge.md:1 msgid "bge(x, y): Bitwise Greater or Equal" -msgstr "" +msgstr "bge(x, y):按位大于或等于" #: ../../doc/src/intrinsics/bit/bge.md:3 msgid "Bitwise greater than or equal to." -msgstr "" +msgstr "按位大于或等于。" #: ../../doc/src/intrinsics/bit/bge.md:16 #: ../../doc/src/intrinsics/bit/bgt.md:16 #: ../../doc/src/intrinsics/bit/ble.md:16 #: ../../doc/src/intrinsics/bit/blt.md:16 msgid "`x` and `y` are integer input values. Both input values are of same kind." -msgstr "" +msgstr "`x` 和 `y` 是整数输入值。两个输入值是同一类型的。" #: ../../doc/src/intrinsics/bit/bge.md:20 #: ../../doc/src/intrinsics/bit/bgt.md:20 #: ../../doc/src/intrinsics/bit/ble.md:20 #: ../../doc/src/intrinsics/bit/blt.md:20 msgid "The return value is of type logical and of the default kind." -msgstr "" +msgstr "返回值是逻辑类型和默认类型。" #: ../../doc/src/intrinsics/bit/bge.md:24 msgid "" "`bge(x, y)` calculates if two integer input values is bitwise greater " "than or equal to another." -msgstr "" +msgstr "`bge(x, y)` 计算两个整数输入值是否按位大于或等于另一个。" #: ../../doc/src/intrinsics/bit/bge.md:29 #: ../../doc/src/intrinsics/bit/bgt.md:29 @@ -2278,7 +2281,7 @@ msgstr "" #: ../../doc/src/intrinsics/bit/blt.md:29 #: ../../doc/src/intrinsics/bit/btest.md:34 msgid "Supported input types is integer of 32 bit and 64 bit size." -msgstr "" +msgstr "支持的输入类型是 32 位和 64 位大小的整数。" #: ../../doc/src/intrinsics/bit/bge.md:60 #: ../../doc/src/intrinsics/bit/bgt.md:59 @@ -2316,110 +2319,111 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/gamma.md:67 #: ../../doc/src/intrinsics/numeric/mod.md:89 msgid "**Result:**" -msgstr "" +msgstr "**结果:**" #: ../../doc/src/intrinsics/bit/bge.md:70 msgid "[bgt](bgt.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md),[ble](ble.md),[blt](blt.md)。" #: ../../doc/src/intrinsics/bit/bgt.md:1 msgid "bgt(x, y): Bitwise Greater Than" -msgstr "" +msgstr "bgt(x, y):按位大于" #: ../../doc/src/intrinsics/bit/bgt.md:3 msgid "Bitwise greater than." -msgstr "" +msgstr "按位大于。" #: ../../doc/src/intrinsics/bit/bgt.md:24 msgid "" "`bgt(x, y)` calculates if one integer input values is bitwise greater " "than the other." -msgstr "" +msgstr "`bgt(x, y)` 计算一个整数输入值是否按位大于另一个。" #: ../../doc/src/intrinsics/bit/bgt.md:68 msgid "[bge](bge.md), [ble](ble.md), [blt](blt.md)." -msgstr "" +msgstr "[bge](bge.md),[ble](ble.md),[blt](blt.md)。" #: ../../doc/src/intrinsics/bit/bit_size.md:1 msgid "bit_size(x): Bit Size" -msgstr "" +msgstr "bit_size(x): 位大小" #: ../../doc/src/intrinsics/bit/bit_size.md:3 msgid "Bit size." -msgstr "" +msgstr "位大小。" #: ../../doc/src/intrinsics/bit/bit_size.md:16 msgid "`x` is integer input value." -msgstr "" +msgstr "`x` 是整数输入值。" #: ../../doc/src/intrinsics/bit/bit_size.md:20 #: ../../doc/src/intrinsics/numeric/digits.md:19 msgid "The return value is of type integer." -msgstr "" +msgstr "返回值是整数类型。" #: ../../doc/src/intrinsics/bit/bit_size.md:24 msgid "" "`bit_size(x)` calculates the number of bits including sign bit of binary " "representation of `x`." -msgstr "" +msgstr "`bit_size(x)` 计算 `x` 的二进制表示的包括符号位在内的位数。" #: ../../doc/src/intrinsics/bit/bit_size.md:29 msgid "Supported input types is integer." -msgstr "" +msgstr "支持的输入类型是整数。" #: ../../doc/src/intrinsics/bit/ble.md:1 msgid "bge(x, y): Bitwise Less or Equal" -msgstr "" +msgstr "bge(x, y):按位小于或等于" #: ../../doc/src/intrinsics/bit/ble.md:3 msgid "Bitwise less than or equal to." -msgstr "" +msgstr "按位小于或等于。" #: ../../doc/src/intrinsics/bit/ble.md:24 msgid "" "`ble(x, y)` calculates if one integer input values is bitwise less than " "or equal to other." -msgstr "" +msgstr "`ble(x, y)` 计算一个整数输入值是否按位小于或等于另一个。" #: ../../doc/src/intrinsics/bit/ble.md:70 msgid "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." -msgstr "" +msgstr "[bgt](bgt.md), [bge](bge.md), [blt](blt.md)." #: ../../doc/src/intrinsics/bit/blt.md:1 msgid "blt(x, y): Bitwise Less Than" -msgstr "" +msgstr "blt(x, y):按位小于" #: ../../doc/src/intrinsics/bit/blt.md:3 msgid "Bitwise less than." -msgstr "" +msgstr "按位小于。" #: ../../doc/src/intrinsics/bit/blt.md:24 msgid "" "`blt(x, y)` calculates if one integer input values is bitwise less than " "the other." -msgstr "" +msgstr "`blt(x, y)` 计算一个整数输入值是否按位小于另一个。" #: ../../doc/src/intrinsics/bit/blt.md:68 msgid "[bge](bge.md), [ble](ble.md), [bgt](bgt.md)." -msgstr "" +msgstr "[bge](bge.md), [ble](ble.md),[bgt](bgt.md)。" #: ../../doc/src/intrinsics/bit/btest.md:1 msgid "btest(x, pos): Bit Test at Position" -msgstr "" +msgstr "btest(x, pos):位置位测试" #: ../../doc/src/intrinsics/bit/btest.md:3 msgid "Bit test." -msgstr "" +msgstr "位测试。" #: ../../doc/src/intrinsics/bit/btest.md:16 msgid "" "`x` and `pos` are integer input values. Both input values are of same " "kind. `pos` represents position in `x`." -msgstr "" +msgstr "`x` 和 `pos` 是整数输入值。 两个输入值是同一种类型。 `pos` 表示在 `x` " +"中的位置。" #: ../../doc/src/intrinsics/bit/btest.md:21 msgid "The return value is of type logical." -msgstr "" +msgstr "返回值是逻辑类型。" #: ../../doc/src/intrinsics/bit/btest.md:25 msgid "" @@ -2427,37 +2431,40 @@ msgid "" "set. The counting of the bits starts at 0, at least significant bit (LSB)" " i.e., the rightmost bit in `x`." msgstr "" +"`btest(x, pos)` 计算输入整数值 `x` 中的 `pos` 位是否已设置。 位的计数从 0 " +"开始,至少是有效位 (LSB),即“x”中的最右边位。" #: ../../doc/src/intrinsics/bit/btest.md:29 msgid "" "If `pos` less than 0 or greater than `bit_size()`, `btest(x, pos)` errors" " with not allowed message." -msgstr "" +msgstr "如果 `pos` 小于 0 或大于 `bit_size()`,则 `btest(x, pos)` " +"错误并显示不允许的消息。" #: ../../doc/src/intrinsics/bit/shiftl.md:1 msgid "shiftl(x, shift): Shift Left" -msgstr "" +msgstr "shiftl(x, shift):左移" #: ../../doc/src/intrinsics/bit/shiftl.md:3 msgid "Logical shift left function." -msgstr "" +msgstr "逻辑左移函数。" #: ../../doc/src/intrinsics/bit/shiftl.md:16 #: ../../doc/src/intrinsics/bit/shiftr.md:16 msgid "`x` is an integer input value." -msgstr "" +msgstr "`x` 是一个整数输入值。" #: ../../doc/src/intrinsics/bit/shiftl.md:18 #: ../../doc/src/intrinsics/bit/shiftr.md:18 msgid "" "`shift` an unsigned integer value less than or equal to the bit size of " "`x`. The possible values are 7, 31, and 63." -msgstr "" +msgstr "`shift` 一个小于或等于 `x` 位大小的无符号整数值。 可能的值为 7、31 和 63。" #: ../../doc/src/intrinsics/bit/shiftl.md:23 #: ../../doc/src/intrinsics/bit/shiftr.md:23 msgid "The return value is of type integer and of the same kind as `x`." -msgstr "" +msgstr "返回值是整数类型,与 `x` 类型相同。" #: ../../doc/src/intrinsics/bit/shiftl.md:27 msgid "" @@ -2466,25 +2473,29 @@ msgid "" "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." msgstr "" +"**shiftl(x, shift)** 逻辑上将“x”左移“shift”位数。 `shiftl` 从 LSB(**L**east " +"**S**significant **B**it) 转换为 MSB(**M**ost **S**significant **B**it)。 " +"从左端移位的位,即 MSB 位丢失。 零被附加到相反的右端。" #: ../../doc/src/intrinsics/bit/shiftl.md:34 #: ../../doc/src/intrinsics/bit/shiftr.md:34 msgid "" "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`." -msgstr "" +msgstr "无符号整数值`x`和无符号整数值`shift`中支持的类型(7、31、63)小于或等于`x`的" +"位大小。" #: ../../doc/src/intrinsics/bit/shiftl.md:82 msgid "[shiftr](shiftr.md)." -msgstr "" +msgstr "[shiftr](shiftr.md)。" #: ../../doc/src/intrinsics/bit/shiftr.md:1 msgid "shiftr(x, shift): Shift Right" -msgstr "" +msgstr "shiftr(x, shift):右移" #: ../../doc/src/intrinsics/bit/shiftr.md:3 msgid "Logical shift right function." -msgstr "" +msgstr "逻辑右移功能。" #: ../../doc/src/intrinsics/bit/shiftr.md:27 msgid "" @@ -2493,28 +2504,31 @@ msgid "" "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." msgstr "" +"**shiftr(x, shift)** 将“x”逻辑右移“shift”位数。 `shiftr` 从 MSB(**M**ost " +"**S**significant **B**it) 转换为 LSB(**L**east **S**significant **B**it)。 " +"从右端移位的位,即 LSB 位丢失。 零被附加到相对的左端。" #: ../../doc/src/intrinsics/bit/shiftr.md:82 msgid "[shiftl](shiftl.md)." -msgstr "" +msgstr "[shiftl](shiftl.md)。" #: ../../doc/src/intrinsics/character.md:1 msgid "Character Intrinsic Functions" -msgstr "" +msgstr "字符内置函数" #: ../../doc/src/intrinsics/character/achar.md:1 msgid "achar(x, kind): To Character in ASCII set." -msgstr "" +msgstr "achar(x, kind): ASCII 集中的字符。" #: ../../doc/src/intrinsics/character/achar.md:3 msgid "Character represented by in the ASCII character set." -msgstr "" +msgstr "ASCII 字符集中由 表示的字符。" #: ../../doc/src/intrinsics/character/achar.md:16 msgid "" "`x`: the input value of integer type. `kind`: an optional input value of " "type integer constant expression for initialization." -msgstr "" +msgstr "`x`:整数类型的输入值。 `kind`:用于初始化的整数常量表达式类型的可选输入值。" #: ../../doc/src/intrinsics/character/achar.md:20 #: ../../doc/src/intrinsics/character/adjustl.md:18 @@ -2522,25 +2536,25 @@ msgstr "" #: ../../doc/src/intrinsics/character/char.md:21 #: ../../doc/src/intrinsics/character/len_trim.md:18 msgid "Return value" -msgstr "" +msgstr "返回值" #: ../../doc/src/intrinsics/character/achar.md:22 #: ../../doc/src/intrinsics/character/char.md:23 msgid "The return value is of type character of length 1." -msgstr "" +msgstr "返回值是长度为 1 的字符类型。" #: ../../doc/src/intrinsics/character/achar.md:24 #: ../../doc/src/intrinsics/character/char.md:25 msgid "" "The return value is of kind `kind` if optional input value is passed, " "otherwise the kind is default kind." -msgstr "" +msgstr "如果传入可选输入值,则返回值为 kind `kind`,否则为默认 kind。" #: ../../doc/src/intrinsics/character/achar.md:29 msgid "" "**achar(x, kind)** returns the character represented by the ASCII " "character set at `x` position." -msgstr "" +msgstr "**achar(x, kind)** 返回由 ASCII 字符集在 `x` 位置表示的字符。" #: ../../doc/src/intrinsics/character/achar.md:32 #: ../../doc/src/intrinsics/character/char.md:33 @@ -2548,160 +2562,165 @@ msgid "" "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." -msgstr "" +msgstr "如果 `x` 在 ASCII 字符集整数值之外,即,如果 `x` 没有在 ASCII " +"字符集中表示,则返回值未定义。" #: ../../doc/src/intrinsics/character/achar.md:35 #: ../../doc/src/intrinsics/character/char.md:36 msgid "It is a runtime builtin function." -msgstr "" +msgstr "它是一个运行时内置函数。" #: ../../doc/src/intrinsics/character/achar.md:71 #: ../../doc/src/intrinsics/character/adjustl.md:64 #: ../../doc/src/intrinsics/character/len_trim.md:65 msgid "[lge](lge.md)." -msgstr "" +msgstr "[lge](lge.md)." #: ../../doc/src/intrinsics/character/adjustl.md:1 msgid "adjustl(string): Left Adjust String" -msgstr "" +msgstr "adjustl(string): 左调整字符串" #: ../../doc/src/intrinsics/character/adjustl.md:3 msgid "Left adjust a string." -msgstr "" +msgstr "左调整一个字符串。" #: ../../doc/src/intrinsics/character/adjustl.md:16 #: ../../doc/src/intrinsics/character/adjustr.md:16 msgid "`string`: the input value must be of character type." -msgstr "" +msgstr "`string`:输入值必须是字符类型。" #: ../../doc/src/intrinsics/character/adjustl.md:20 msgid "" "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." -msgstr "" +msgstr "返回值是字符类型,与输入值`string`的类型相同,删除了前导空格并附加了相同数量" +"的空格。" #: ../../doc/src/intrinsics/character/adjustl.md:25 msgid "" "**adjustl(string)** adjusts input string by removing any leading spaces " "and appending same number of spaces." -msgstr "" +msgstr "**adjustl(string)** " +"通过删除任何前导空格并附加相同数量的空格来调整输入字符串。" #: ../../doc/src/intrinsics/character/adjustl.md:30 #: ../../doc/src/intrinsics/character/adjustr.md:31 msgid "Supported argument type is character." -msgstr "" +msgstr "支持的参数类型是字符。" #: ../../doc/src/intrinsics/character/adjustr.md:1 msgid "adjustr(string): Right Adjust String" -msgstr "" +msgstr "调整器(字符串):右调整字符串" #: ../../doc/src/intrinsics/character/adjustr.md:3 msgid "Right adjust a string." -msgstr "" +msgstr "右调整一个字符串。" #: ../../doc/src/intrinsics/character/adjustr.md:20 msgid "" "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." -msgstr "" +msgstr "返回值是字符类型,与输入值`string`的类型相同,删除了尾随空格并在开头添加了相" +"同数量的空格。" #: ../../doc/src/intrinsics/character/adjustr.md:26 msgid "" "**adjustr(string)** adjusts input string by removing any trailing spaces " "and adding same number of spaces at the start of the input string." -msgstr "" +msgstr "**adjustr(string)** " +"通过删除任何尾随空格并在输入字符串的开头添加相同数量的空格来调整输入字符串。" #: ../../doc/src/intrinsics/character/adjustr.md:65 msgid "[adjustl](adjustl.md)." -msgstr "" +msgstr "[adjustl](adjustl.md)。" #: ../../doc/src/intrinsics/character/char.md:1 msgid "char(x, [, kind]): Integer to Character" -msgstr "" +msgstr "char(x, [, kind]):整数到字符" #: ../../doc/src/intrinsics/character/char.md:3 msgid "Integer to character conversion." -msgstr "" +msgstr "整数到字符的转换。" #: ../../doc/src/intrinsics/character/char.md:16 msgid "`x`: the input value of integer type." -msgstr "" +msgstr "`x`:整数类型的输入值。" #: ../../doc/src/intrinsics/character/char.md:18 msgid "" "`kind`: an optional input value of type integer constant expression for " "initialization. This indicates the kind parameter of the result." -msgstr "" +msgstr "`kind`:用于初始化的整数常量表达式类型的可选输入值。 这表示结果的种类参数。" #: ../../doc/src/intrinsics/character/char.md:30 msgid "" "**char(x)** returns the character represented by the ASCII character set " "at `x` position." -msgstr "" +msgstr "**char(x)** 返回由 ASCII 字符集在 `x` 位置表示的字符。" #: ../../doc/src/intrinsics/character/char.md:71 msgid "[achar](achar.md), [iachar](iachar.md), [ichar](ichar.md)" -msgstr "" +msgstr "[achar](achar.md),[iachar](iachar.md),[ichar](ichar.md)" #: ../../doc/src/intrinsics/character/len_trim.md:1 msgid "len_trim(string): Length Ignoring Trailing Blanks" -msgstr "" +msgstr "len_trim(string): 忽略尾随空格的长度" #: ../../doc/src/intrinsics/character/len_trim.md:3 msgid "Length of a character string ignoring trailing blank character(s)." -msgstr "" +msgstr "忽略尾随空白字符的字符串长度。" #: ../../doc/src/intrinsics/character/len_trim.md:16 msgid "`string` the input value of character type." -msgstr "" +msgstr "`string` 字符类型的输入值。" #: ../../doc/src/intrinsics/character/len_trim.md:20 msgid "The return value is of type unsigned integer." -msgstr "" +msgstr "返回值是无符号整数类型。" #: ../../doc/src/intrinsics/character/len_trim.md:24 msgid "" "**len_trim(string)** returns the length of the character argument without" " including trailing blank character(s)." -msgstr "" +msgstr "**len_trim(string)** 返回字符参数的长度,不包括尾随空白字符。" #: ../../doc/src/intrinsics/character/len_trim.md:29 msgid "Supported argument type is character scalar." -msgstr "" +msgstr "支持的参数类型是字符标量。" #: ../../doc/src/intrinsics/character/lge.md:1 msgid "lge(x, y): Lexically Greater or Equal" -msgstr "" +msgstr "lge(x, y):词法上大于或等于" #: ../../doc/src/intrinsics/character/lge.md:3 msgid "Lexically greater than or equal." -msgstr "" +msgstr "词法上大于或等于。" #: ../../doc/src/intrinsics/character/lge.md:17 msgid "`x` input value of type character." -msgstr "" +msgstr "`x` 类型字符的输入值。" #: ../../doc/src/intrinsics/character/lge.md:19 msgid "`y` input value of type character." -msgstr "" +msgstr "`y` 类型字符的输入值。" #: ../../doc/src/intrinsics/character/lge.md:21 msgid "`x` and `y` can be seen as string A and string B." -msgstr "" +msgstr "`x` 和 `y` 可以看作是字符串 A 和字符串 B。" #: ../../doc/src/intrinsics/character/lge.md:25 msgid "The return value is of logical `true` or `false` type." -msgstr "" +msgstr "返回值是逻辑 `true` 或 `false` 类型。" #: ../../doc/src/intrinsics/character/lge.md:27 msgid "`True` if `x` string is lexically greater than or equal to `y`." -msgstr "" +msgstr "如果 `x` 字符串在词法上大于或等于 `y`,则为 `True`。" #: ../../doc/src/intrinsics/character/lge.md:29 msgid "`False` if they are not." -msgstr "" +msgstr "如果不是,则为`False`。" #: ../../doc/src/intrinsics/character/lge.md:33 msgid "" @@ -2709,46 +2728,49 @@ msgid "" " equal to input string `y`. The two strings in comparison are interpreted" " as containing ASCII character codes." msgstr "" +"**lge(x, y)** 确定输入字符串 `x` 在词法上是否大于或等于输入字符串 `y`。 " +"比较的两个字符串被解释为包含 ASCII 字符代码。" #: ../../doc/src/intrinsics/character/lge.md:39 msgid "Argument types should be of type character literal." -msgstr "" +msgstr "参数类型应该是字符文字类型。" #: ../../doc/src/intrinsics/character/lge.md:81 msgid "[len_trim](len_trim.md)." -msgstr "" +msgstr "[len_trim](len_trim.md)." #: ../../doc/src/intrinsics/kind-type.md:1 msgid "Kind Type Intrinsic Functions" -msgstr "" +msgstr "种类类型内置函数" #: ../../doc/src/intrinsics/kind-type/kind.md:1 msgid "kind(x): Kind of an Entity" -msgstr "" +msgstr "kind(x):实体的种类" #: ../../doc/src/intrinsics/kind-type/kind.md:3 msgid "Kind of an entity." -msgstr "" +msgstr "一种实体。" #: ../../doc/src/intrinsics/kind-type/kind.md:16 msgid "" "`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." -msgstr "" +msgstr "`x` 输入值,可以是逻辑、整数、实数、复数或字符。 " +"它可以是标量或数组值,即任何内在类型。" #: ../../doc/src/intrinsics/kind-type/kind.md:21 msgid "The return value is of integer type and of default integer kind." -msgstr "" +msgstr "返回值是整数类型和默认整数类型。" #: ../../doc/src/intrinsics/kind-type/kind.md:25 msgid "**kind(x)** returns the kind parameter of the input argument `x`." -msgstr "" +msgstr "**kind(x)** 返回输入参数 `x` 的种类参数。" #: ../../doc/src/intrinsics/kind-type/kind.md:29 msgid "" "Supported argument types are logical, integer, real, complex, or " "character." -msgstr "" +msgstr "支持的参数类型是逻辑、整数、实数、复数或字符。" #: ../../doc/src/intrinsics/kind-type/kind.md:81 #: ../../doc/src/intrinsics/misc/command_argument_count.md:16 @@ -2760,21 +2782,21 @@ msgstr "无。" #: ../../doc/src/intrinsics/mathematical.md:1 msgid "Mathematical Intrinsic Functions" -msgstr "" +msgstr "数学内置函数" #: ../../doc/src/intrinsics/mathematical/acos.md:1 msgid "acos(x): Trigonometric Arc Cosine" -msgstr "" +msgstr "acos(x):三角反余弦" #: ../../doc/src/intrinsics/mathematical/acos.md:3 msgid "Trigonometric arc cosine (inverse cosine) function." -msgstr "" +msgstr "三角反余弦(反余弦)函数。" #: ../../doc/src/intrinsics/mathematical/acos.md:16 #: ../../doc/src/intrinsics/mathematical/asin.md:16 #: ../../doc/src/intrinsics/mathematical/atan.md:16 msgid "`x` the input value, can be real or complex; less than or equal to 1." -msgstr "" +msgstr "`x` 输入值,可以是实数或复数; 小于或等于 1。" #: ../../doc/src/intrinsics/mathematical/acos.md:20 #: ../../doc/src/intrinsics/mathematical/acosh.md:21 @@ -2785,18 +2807,19 @@ msgstr "" msgid "" "The returned value has the kind of the input value and TYPE may be real " "or complex." -msgstr "" +msgstr "返回值具有输入值的种类,TYPE 可能是实数或复数。" #: ../../doc/src/intrinsics/mathematical/acos.md:25 msgid "**acos(x)** computes the arcsine of the argument **x**." -msgstr "" +msgstr "**acos(x)** 计算参数 **x** 的反正弦值。" #: ../../doc/src/intrinsics/mathematical/acos.md:27 msgid "" "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." -msgstr "" +msgstr "反余弦是余弦函数的反函数。 " +"当已知直角三角形的斜边和底边的长度时,它通常用于三角学中以找到角度。" #: ../../doc/src/intrinsics/mathematical/acos.md:33 #: ../../doc/src/intrinsics/mathematical/acosh.md:45 @@ -2805,19 +2828,19 @@ msgstr "" #: ../../doc/src/intrinsics/mathematical/atan.md:33 #: ../../doc/src/intrinsics/mathematical/atanh.md:41 msgid "Supported argument types float, double, complex float, complex double." -msgstr "" +msgstr "支持的参数类型 float、double、complex float、complex double。" #: ../../doc/src/intrinsics/mathematical/acos.md:84 msgid "[asin](asin.md), [atan](atan.md)." -msgstr "" +msgstr "[asin](asin.md),[atan](atan.md)。" #: ../../doc/src/intrinsics/mathematical/acosh.md:1 msgid "acosh(x): Inverse Hyperbolic Cosine" -msgstr "" +msgstr "acosh(x):反双曲余弦" #: ../../doc/src/intrinsics/mathematical/acosh.md:3 msgid "Inverse hyperbolic cosine function." -msgstr "" +msgstr "反双曲余弦函数。" #: ../../doc/src/intrinsics/mathematical/acosh.md:16 #: ../../doc/src/intrinsics/mathematical/asinh.md:16 @@ -2825,108 +2848,110 @@ msgstr "" msgid "" "`x` the input value, can be real with value greater than or equal to 1 or" " of type complex." -msgstr "" +msgstr "`x` 输入值,可以是大于或等于 1 的实数,也可以是复数类型。" #: ../../doc/src/intrinsics/mathematical/acosh.md:26 msgid "**acosh(x)** computes the inverse hyperbolic cosine function of **x**." -msgstr "" +msgstr "**acosh(x)** 计算 **x** 的反双曲余弦函数。" #: ../../doc/src/intrinsics/mathematical/acosh.md:28 #: ../../doc/src/intrinsics/mathematical/asinh.md:28 #: ../../doc/src/intrinsics/mathematical/atanh.md:28 msgid "The result type and kind are the same as input value `x`." -msgstr "" +msgstr "结果类型和种类与输入值`x`相同。" #: ../../doc/src/intrinsics/mathematical/acosh.md:30 msgid "" "If the result is complex, the real part is non-negative, and the " "imaginary part is expressed in radians and lients in the range" -msgstr "" +msgstr "如果结果为复数,则实部为非负数,虚部以弧度和范围内的 lients 表示" #: ../../doc/src/intrinsics/mathematical/acosh.md:33 msgid "$-\\pi <= img (acosh(x)) <= \\pi$" -msgstr "" +msgstr "$-\\pi <= img (acosh(x)) <= \\pi$" #: ../../doc/src/intrinsics/mathematical/acosh.md:35 msgid "" "For real values $x$ in the domain $x > 1$, the inverse hyperbolic cosine " "satisifies:" -msgstr "" +msgstr "对于域 $x > 1$ 中的实数值 $x$,反双曲余弦满足:" #: ../../doc/src/intrinsics/mathematical/acosh.md:38 msgid "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" -msgstr "" +msgstr "$cosh^{-1}(x) = \\log(x + \\sqrt{(x^2 - 1)})$" #: ../../doc/src/intrinsics/mathematical/acosh.md:40 msgid "" "For complex numbers $x = x + iy$, as well as real values in the domain " "$-\\infty < z <= 1$, the call $acosh(z)$ returns complex results." -msgstr "" +msgstr "对于复数 $x = x + iy$,以及域 $-\\infty < z <= 1$ 中的实数值,调用 $acosh(z)$" +" 返回复数结果。" #: ../../doc/src/intrinsics/mathematical/acosh.md:88 msgid "[asinh](asinh.md), [atanh](atanh.md)." -msgstr "" +msgstr "[asinh](asinh.md),[atanh](atanh.md)。" #: ../../doc/src/intrinsics/mathematical/asin.md:1 msgid "asin(x): Trigonometric Arcsine" -msgstr "" +msgstr "asin(x):三角反正弦" #: ../../doc/src/intrinsics/mathematical/asin.md:3 msgid "Trigonometric arcsine function." -msgstr "" +msgstr "三角反正弦函数。" #: ../../doc/src/intrinsics/mathematical/asin.md:25 msgid "**asin(x)** computes the arcsine of the argument **x**." -msgstr "" +msgstr "**asin(x)** 计算参数 **x** 的反正弦值。" #: ../../doc/src/intrinsics/mathematical/asin.md:27 msgid "" "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." -msgstr "" +msgstr "反正弦是正弦函数的反函数。 " +"当已知直角三角形的斜边和对边的长度时,它通常用于三角学中以找到角度。" #: ../../doc/src/intrinsics/mathematical/asin.md:84 msgid "[acos](acos.md), [atan](atan.md)." -msgstr "" +msgstr "[acos](acos.md), [atan](atan.md)." #: ../../doc/src/intrinsics/mathematical/asinh.md:1 msgid "asinh(x): Inverse Hyperbolic Arcsine" -msgstr "" +msgstr "asinh(x):反双曲反正弦" #: ../../doc/src/intrinsics/mathematical/asinh.md:3 msgid "Inverse hyperbolic arcsine function." -msgstr "" +msgstr "反双曲反正弦函数。" #: ../../doc/src/intrinsics/mathematical/asinh.md:26 msgid "**asinh(x)** computes the inverse hyperbolic arcsine function of **x**." -msgstr "" +msgstr "**asinh(x)** 计算 **x** 的反双曲反正弦函数。" #: ../../doc/src/intrinsics/mathematical/asinh.md:30 msgid "" "If the result is complex, the real part is non-negative, and the " "imaginary part is expressed in radians and lies in the range" -msgstr "" +msgstr "如果结果为复数,则实部为非负数,虚部以弧度表示,位于范围内" #: ../../doc/src/intrinsics/mathematical/asinh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" -msgstr "" +msgstr "$\\frac{-\\pi}{2} <= aimag (asinh(x)) <= \\frac{\\pi}{2}$" #: ../../doc/src/intrinsics/mathematical/asinh.md:80 msgid "[acosh](acosh.md), [atanh](atanh.md)." -msgstr "" +msgstr "[acosh](acosh.md), [atanh](atanh.md)." #: ../../doc/src/intrinsics/mathematical/atan.md:1 msgid "atan(x): Trigonometric ArcTangent" -msgstr "" +msgstr "atan(x):三角函数 ArcTangent" #: ../../doc/src/intrinsics/mathematical/atan.md:3 msgid "Trigonometric arctangent (inverse arctangent) function." -msgstr "" +msgstr "三角反正切(反正切)函数。" #: ../../doc/src/intrinsics/mathematical/atan.md:25 msgid "**atan(x)** computes the arctangent of the argument **x**." -msgstr "" +msgstr "**atan(x)** 计算参数 **x** 的反正切。" #: ../../doc/src/intrinsics/mathematical/atan.md:27 msgid "" @@ -2934,40 +2959,42 @@ msgid "" " 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." -msgstr "" +msgstr "反正切是反正切函数的反函数。 当直角三角形的对边和底边的长度已知时,即垂直和底" +"边长度,它通常用于三角学中找到角度。" #: ../../doc/src/intrinsics/mathematical/atan.md:84 msgid "[asin](asin.md), [acos](acos.md)." -msgstr "" +msgstr "[asin](asin.md), [acos](acos.md)." #: ../../doc/src/intrinsics/mathematical/atan2.md:1 msgid "atan2(y, x): ArcTangent" -msgstr "" +msgstr "atan2(y, x):反正切" #: ../../doc/src/intrinsics/mathematical/atan2.md:3 msgid "Arctangent function or inverse tangent function." -msgstr "" +msgstr "反正切函数或反正切函数。" #: ../../doc/src/intrinsics/mathematical/atan2.md:15 msgid "`y` the input value is the imaginary part of the complex expression" -msgstr "" +msgstr "`y` 输入值是复数表达式的虚部" #: ../../doc/src/intrinsics/mathematical/atan2.md:17 #: ../../doc/src/intrinsics/numeric/aimag.md:29 #: ../../doc/src/intrinsics/numeric/cmplx.md:43 msgid "$x + iy$" -msgstr "" +msgstr "$x + iy$" #: ../../doc/src/intrinsics/mathematical/atan2.md:19 msgid "`x` the input value, must be real part of the complex expression." -msgstr "" +msgstr "`x` 输入值,必须是复数表达式的实部。" #: ../../doc/src/intrinsics/mathematical/atan2.md:23 msgid "" "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." -msgstr "" +msgstr "返回值具有与输入值 `y` 相同的种类和类型。 返回复杂表达式 $x + iy$ " +"的参数函数的主值。" #: ../../doc/src/intrinsics/mathematical/atan2.md:29 msgid "" @@ -2976,157 +3003,159 @@ msgid "" " into polar coordinates and allows to determine the angle in the correct " "quadrant." msgstr "" +"**atan2(y, x)** 计算复数表达式 $x + iy$ 的参数函数的主值。 " +"这用于从笛卡尔坐标转换为极坐标,并允许确定正确象限中的角度。" #: ../../doc/src/intrinsics/mathematical/atan2.md:33 msgid "It is also represented as:" -msgstr "" +msgstr "它也表示为:" #: ../../doc/src/intrinsics/mathematical/atan2.md:35 msgid "$tan^{-1}(\\frac{y}{x})$" -msgstr "" +msgstr "$tan^{-1}(\\frac{y}{x})$" #: ../../doc/src/intrinsics/mathematical/atan2.md:37 msgid "If `x` is nonzero, the result lies in the range:" -msgstr "" +msgstr "如果 `x` 不为零,则结果位于以下范围内:" #: ../../doc/src/intrinsics/mathematical/atan2.md:39 msgid "$-\\pi <= atan(x) <= \\pi$" -msgstr "" +msgstr "$-\\pi <= atan(x) <= \\pi$" #: ../../doc/src/intrinsics/mathematical/atan2.md:41 msgid "The sign is positive if `y` is positive." -msgstr "" +msgstr "如果`y`为正,则符号为正。" #: ../../doc/src/intrinsics/mathematical/atan2.md:43 msgid "If `y` is zero and `x` is strictly positive, then the result is 0." -msgstr "" +msgstr "如果 `y` 为零且 `x` 严格为正,则结果为 0。" #: ../../doc/src/intrinsics/mathematical/atan2.md:45 msgid "If `x` is negative and `y` is positive zero, then the result is $\\pi$." -msgstr "" +msgstr "如果 `x` 为负数且 `y` 为正零,则结果为 $\\pi$。" #: ../../doc/src/intrinsics/mathematical/atan2.md:47 msgid "If `x` is negative and `y` is negative zero, then the result is $-\\pi$." -msgstr "" +msgstr "如果 `x` 为负且 `y` 为负零,则结果为 $-\\pi$。" #: ../../doc/src/intrinsics/mathematical/atan2.md:49 msgid "If `x` is zero, then the magnitude of the result is $\\frac{\\pi}{2}$." -msgstr "" +msgstr "如果 `x` 为零,则结果的大小为 $\\frac{\\pi}{2}$。" #: ../../doc/src/intrinsics/mathematical/atan2.md:51 msgid "If `y` is negative real zero, the result is $\\frac{-\\pi}{2}$." -msgstr "" +msgstr "如果 `y` 为负实零,则结果为 $\\frac{-\\pi}{2}$。" #: ../../doc/src/intrinsics/mathematical/atan2.md:55 #: ../../doc/src/intrinsics/mathematical/fraction.md:32 msgid "Supported argument type is real." -msgstr "" +msgstr "支持的参数类型是实数。" #: ../../doc/src/intrinsics/mathematical/atanh.md:1 msgid "atanh(x): Inverse Hyperbolic Tangent" -msgstr "" +msgstr "atanh(x):反双曲正切" #: ../../doc/src/intrinsics/mathematical/atanh.md:3 msgid "Inverse hyperbolic tangent function." -msgstr "" +msgstr "反双曲正切函数。" #: ../../doc/src/intrinsics/mathematical/atanh.md:26 msgid "**atanh(x)** computes the inverse hyperbolic tangent function of **x**." -msgstr "" +msgstr "**atanh(x)** 计算 **x** 的反双曲正切函数。" #: ../../doc/src/intrinsics/mathematical/atanh.md:30 msgid "" "If the result is complex, the imaginary part is expressed in radians and " "lies in the range" -msgstr "" +msgstr "如果结果为复数,则虚部以弧度表示,位于范围内" #: ../../doc/src/intrinsics/mathematical/atanh.md:33 msgid "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" -msgstr "" +msgstr "$\\frac{-\\pi}{2} <= aimag (atanh(x)) <= \\frac{\\pi}{2}$" #: ../../doc/src/intrinsics/mathematical/atanh.md:35 msgid "If the result is real, it lies in the range" -msgstr "" +msgstr "如果结果是实数,它位于范围内" #: ../../doc/src/intrinsics/mathematical/atanh.md:37 msgid "$-1.0 < atanh(x) < 1.0$" -msgstr "" +msgstr "$-1.0 < atanh(x) < 1.0$" #: ../../doc/src/intrinsics/mathematical/atanh.md:84 msgid "[asinh](asinh.md), [acosh](acosh.md)." -msgstr "" +msgstr "[asinh](asinh.md),[acosh](acosh.md)。" #: ../../doc/src/intrinsics/mathematical/fraction.md:1 msgid "fraction(x): Fractional Part in Model Representation" -msgstr "" +msgstr "fraction(x):模型表示中的小数部分" #: ../../doc/src/intrinsics/mathematical/fraction.md:3 msgid "Fractional part of the model representation." -msgstr "" +msgstr "模型表示的小数部分。" #: ../../doc/src/intrinsics/mathematical/fraction.md:15 msgid "`x` the input value, must be real." -msgstr "" +msgstr "`x` 输入值,必须是实数。" #: ../../doc/src/intrinsics/mathematical/fraction.md:19 msgid "" "The returned value has the kind of the input value. The fractional part " "of the model representation of the input value is returned." -msgstr "" +msgstr "返回值具有输入值的种类。 返回输入值的模型表示的小数部分。" #: ../../doc/src/intrinsics/mathematical/fraction.md:24 msgid "" "**fraction(x)** computes the fractional part of the model representation " "of **x**." -msgstr "" +msgstr "**fraction(x)** 计算 **x** 的模型表示的小数部分。" #: ../../doc/src/intrinsics/mathematical/fraction.md:26 #: ../../doc/src/intrinsics/numeric/erf.md:29 #: ../../doc/src/intrinsics/numeric/erfc.md:29 msgid "It is calculated using:" -msgstr "" +msgstr "它是使用以下方法计算的:" #: ../../doc/src/intrinsics/mathematical/fraction.md:28 msgid "$x * {radix(x)}^{(-exponent(x))}$" -msgstr "" +msgstr "$x * {radix(x)}^{(-exponent(x))}$" #: ../../doc/src/intrinsics/misc.md:1 msgid "Miscellaneous Intrinsic Functions" -msgstr "" +msgstr "其他内置函数" #: ../../doc/src/intrinsics/misc/command_argument_count.md:1 msgid "command_argument_count(): Number of Command Line Arguments" -msgstr "" +msgstr "command_argument_count():命令行参数的数量" #: ../../doc/src/intrinsics/misc/command_argument_count.md:3 msgid "Get number of command line arguments." -msgstr "" +msgstr "获取命令行参数的数量。" #: ../../doc/src/intrinsics/misc/command_argument_count.md:20 msgid "The return value is of integer type and of default kind." -msgstr "" +msgstr "返回值是整数类型和默认类型。" #: ../../doc/src/intrinsics/misc/command_argument_count.md:24 msgid "" "**command_argument_count()** returns the number of arguments passed on " "the command line when the named program was invoked." -msgstr "" +msgstr "**command_argument_count()** 返回调用指定程序时在命令行上传递的参数数量。" #: ../../doc/src/intrinsics/misc/command_argument_count.md:29 msgid "Any." -msgstr "" +msgstr "任意。" #: ../../doc/src/intrinsics/misc/cpu_time.md:1 msgid "cpu_time(x): CPU Elapsed Time" -msgstr "" +msgstr "cpu_time(x):CPU 运行时间" #: ../../doc/src/intrinsics/misc/cpu_time.md:3 msgid "CPU elapsed time in seconds." -msgstr "" +msgstr "CPU 运行时间(以秒为单位)。" #: ../../doc/src/intrinsics/misc/cpu_time.md:16 msgid "`x` the input value should be of type real with `intent(out)`." -msgstr "" +msgstr "`x` 输入值应该是带有 `intent(out)` 的实数类型。" #: ../../doc/src/intrinsics/misc/cpu_time.md:24 msgid "" @@ -3135,42 +3164,50 @@ msgid "" "microsecond resolution. If no time source is available, TIME is set to " "-1.0." msgstr "" +"**cpu_time(time)** 返回一个实数值,以秒为单位表示经过的 CPU 时间。 " +"如果齿源可用,时间将以微秒分辨率报告。 如果没有可用的时间源,则将 TIME " +"设置为 -1.0。" #: ../../doc/src/intrinsics/misc/cpu_time.md:28 msgid "This is useful for testing segments of code to determine computation time." -msgstr "" +msgstr "这对于测试代码段以确定计算时间很有用。" #: ../../doc/src/intrinsics/misc/cpu_time.md:30 msgid "" "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." -msgstr "" +msgstr "`cpu_time(time)` 的绝对值是没有意义的,只有后续调用这个子程序之间的差异,如下" +"例所示,应该被使用。" #: ../../doc/src/intrinsics/misc/cpu_time.md:35 #: ../../doc/src/intrinsics/misc/date_and_time.md:55 msgid "Supported input parameter types is real with `intent(out)`." -msgstr "" +msgstr "支持的输入参数类型为 `intent(out)` 和实数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:1 msgid "date_and_time([date, time, zone, values]): Date and Time" -msgstr "" +msgstr "date_and_time([date, time, zone, values]):日期和时间" #: ../../doc/src/intrinsics/misc/date_and_time.md:3 msgid "Date and time subroutine." -msgstr "" +msgstr "日期和时间子程序。" #: ../../doc/src/intrinsics/misc/date_and_time.md:16 msgid "" "`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`." msgstr "" +"`date` 字符类型的输入值,长度为 8 或更大。 它是默认类型。 它是 `intent(out)` " +"并且具有 `ccyymmdd` 的形式。" #: ../../doc/src/intrinsics/misc/date_and_time.md:19 msgid "" "`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`." msgstr "" +"`time` 字符类型的输入值,长度为 10 或更大。 它是默认类型。 它是 `intent(out)`" +" 并且具有 `hhmmss.sss` 的形式。" #: ../../doc/src/intrinsics/misc/date_and_time.md:22 msgid "" @@ -3179,167 +3216,171 @@ msgid "" "representing the difference with respect to Coordinates Universal Time " "(UTC). Unavailable time and date parameters return blanks." msgstr "" +"`zone` 字符类型的输入值,长度为 5 或更大。 它是默认类型。 它是 `intent(out)` " +"并且来自 `(+-)hhmm`,表示相对于坐标世界时 (UTC) 的差异。 " +"不可用的时间和日期参数返回空白。" #: ../../doc/src/intrinsics/misc/date_and_time.md:27 msgid "" "`values` the input value of integer type, 8 bits. It is `intent(out)`. It" " provides the following:" -msgstr "" +msgstr "`values`整数类型的输入值,8位。 它是`intent(out)`。 它提供以下内容:" #: ../../doc/src/intrinsics/misc/date_and_time.md:30 msgid "`value(1)`: The year." -msgstr "" +msgstr "`value(1)`:年份。" #: ../../doc/src/intrinsics/misc/date_and_time.md:31 msgid "`value(2)`: The month." -msgstr "" +msgstr "`value(2)`:月份。" #: ../../doc/src/intrinsics/misc/date_and_time.md:32 msgid "`value(3)`: The day of the month." -msgstr "" +msgstr "`value(3)`:一个月中的哪一天。" #: ../../doc/src/intrinsics/misc/date_and_time.md:33 msgid "`value(4)`: Time difference with UTC in minutes." -msgstr "" +msgstr "`value(4)`:与 UTC 的时差,以分钟为单位。" #: ../../doc/src/intrinsics/misc/date_and_time.md:34 msgid "`value(5)`: The hour of the day." -msgstr "" +msgstr "`value(5)`:一天中的小时。" #: ../../doc/src/intrinsics/misc/date_and_time.md:35 msgid "`value(6)`: The minutes of the hour." -msgstr "" +msgstr "`value(6)`:小时的分钟数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:36 msgid "`value(7)`: The seconds of the minutes." -msgstr "" +msgstr "`value(7)`:分钟的秒数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:37 msgid "`value(8)`: The milliseconds of the second." -msgstr "" +msgstr "`value(8)`:秒的毫秒数。" #: ../../doc/src/intrinsics/misc/date_and_time.md:45 msgid "" "**date_and_time([date, time, zone, values])** reports the corresponding " "date and time information from the real time system clock." -msgstr "" +msgstr "**date_and_time([date, time, zone, values])** " +"从实时系统时钟报告相应的日期和时间信息。" #: ../../doc/src/intrinsics/misc/date_and_time.md:48 msgid "" "`date`, `time`, `zone`, `values` represents date, time, zone, and values" " as decribed in arguments above." -msgstr "" +msgstr "`date`、`time`、`zone`、`values` 表示日期、时间、区域和值,如上述参数中所述。" #: ../../doc/src/intrinsics/misc/date_and_time.md:51 msgid "Unavailable or errorneous date and time parameters return blanks." -msgstr "" +msgstr "不可用或错误的日期和时间参数返回空白。" #: ../../doc/src/intrinsics/misc/date_and_time.md:92 msgid "[cpu_time](cpu_time.md)." -msgstr "" +msgstr "[cpu_time](cpu_time.md)。" #: ../../doc/src/intrinsics/misc/new_line.md:1 msgid "new_line(x): New Line Character" -msgstr "" +msgstr "new_line(x):换行符" #: ../../doc/src/intrinsics/misc/new_line.md:3 msgid "New line character." -msgstr "" +msgstr "换行符。" #: ../../doc/src/intrinsics/misc/new_line.md:16 msgid "" "The input parameter `x` must be of type character. It can be a scalar or " "an array." -msgstr "" +msgstr "输入参数 `x` 必须是字符类型。 它可以是标量或数组。" #: ../../doc/src/intrinsics/misc/new_line.md:21 msgid "" "The return value is a character of length one with the new line character" " appended of the same kind as of `x`." -msgstr "" +msgstr "返回值是一个长度为 1 的字符,并附加了与 `x` 相同类型的换行符。" #: ../../doc/src/intrinsics/misc/new_line.md:26 msgid "" "**new_line(x)** returns the new line character. The return value is the " "ASCII newline character." -msgstr "" +msgstr "**new_line(x)** 返回换行符。 返回值是 ASCII 换行符。" #: ../../doc/src/intrinsics/misc/new_line.md:31 msgid "Supported input parameter types is character." -msgstr "" +msgstr "支持的输入参数类型是字符。" #: ../../doc/src/intrinsics/numeric.md:1 msgid "Numeric Intrinsic Functions" -msgstr "" +msgstr "数值内置函数" #: ../../doc/src/intrinsics/numeric/abs.md:1 msgid "abs(x): Absolute Value" -msgstr "" +msgstr "abs(x):绝对值" #: ../../doc/src/intrinsics/numeric/abs.md:3 msgid "Absolute value." -msgstr "" +msgstr "绝对值。" #: ../../doc/src/intrinsics/numeric/abs.md:17 msgid "`x` the input value, can be integer, real, or complex." -msgstr "" +msgstr "`x` 输入值,可以是整数、实数或复数。" #: ../../doc/src/intrinsics/numeric/abs.md:21 msgid "" "The return value is of type and kind same as of `x`. For complex input " "value, return value is real." -msgstr "" +msgstr "返回值的类型和种类与 `x` 相同。 对于复数输入值,返回值是实数。" #: ../../doc/src/intrinsics/numeric/abs.md:26 msgid "" "**abs(x)** calculates and returns absolute value of `x`. Result is " "calculated using mathematical formula:" -msgstr "" +msgstr "**abs(x)** 计算并返回 `x` 的绝对值。 结果使用数学公式计算:" #: ../../doc/src/intrinsics/numeric/abs.md:29 msgid "$|x|$" -msgstr "" +msgstr "$|x|$" #: ../../doc/src/intrinsics/numeric/abs.md:31 msgid "If `x` is complex, the result is calculated using mathematical formula:" -msgstr "" +msgstr "如果 `x` 是复数,则使用数学公式计算结果:" #: ../../doc/src/intrinsics/numeric/abs.md:33 msgid "$\\sqrt{(x^2 + y^2)}$" -msgstr "" +msgstr "$\\sqrt{(x^2 + y^2)}$" #: ../../doc/src/intrinsics/numeric/abs.md:37 #: ../../doc/src/intrinsics/numeric/digits.md:28 #: ../../doc/src/intrinsics/numeric/dim.md:29 #: ../../doc/src/intrinsics/numeric/mod.md:45 msgid "Supported argument types are real and integer." -msgstr "" +msgstr "支持的参数类型是实数和整数。" #: ../../doc/src/intrinsics/numeric/abs.md:98 #: ../../doc/src/intrinsics/numeric/aimag.md:70 #: ../../doc/src/intrinsics/numeric/mod.md:97 msgid "[ceiling](ceiling.md), [floor](floor.md)." -msgstr "" +msgstr "[ceiling](ceiling.md),[floor](floor.md)。" #: ../../doc/src/intrinsics/numeric/aimag.md:1 msgid "aimag(x): Imaginary Part" -msgstr "" +msgstr "aimag(x):虚部" #: ../../doc/src/intrinsics/numeric/aimag.md:3 msgid "Imaginary part of complex number." -msgstr "" +msgstr "复数的虚部。" #: ../../doc/src/intrinsics/numeric/aimag.md:17 msgid "`x` the input value must be of complex type." -msgstr "" +msgstr "`x` ,输入值必须是复合类型。" #: ../../doc/src/intrinsics/numeric/aimag.md:21 msgid "The return value is imaginary part of type real and kind same as of `x`." -msgstr "" +msgstr "返回值是类型为实数的虚数部分,种类与`x` 相同。" #: ../../doc/src/intrinsics/numeric/aimag.md:25 msgid "**aimag(x)** returns the imaginary part of the input complex argument `x`." -msgstr "" +msgstr "**aimag(x)** 返回输入复参数 `x` 的虚部。" #: ../../doc/src/intrinsics/numeric/aimag.md:27 #: ../../doc/src/intrinsics/numeric/cmplx.md:41 @@ -3347,25 +3388,25 @@ msgstr "" msgid "" "For `x` complex input value, the result is calculated using mathematical " "formula:" -msgstr "" +msgstr "对于 `x` 复数输入值,使用数学公式计算结果:" #: ../../doc/src/intrinsics/numeric/aimag.md:31 #: ../../doc/src/intrinsics/numeric/cmplx.md:45 #: ../../doc/src/intrinsics/numeric/conjg.md:31 msgid "$i$ the imaginary part is the result." -msgstr "" +msgstr "$i$ 虚部是结果。" #: ../../doc/src/intrinsics/numeric/aimag.md:35 msgid "Supported argument types are complex." -msgstr "" +msgstr "支持的参数类型很复杂。" #: ../../doc/src/intrinsics/numeric/aint.md:1 msgid "aint(x, [kind]): Truncate to a Whole Number" -msgstr "" +msgstr "aint(x, [kind]):截断为整数" #: ../../doc/src/intrinsics/numeric/aint.md:3 msgid "Truncate to a whole number." -msgstr "" +msgstr "截断到一个整数。" #: ../../doc/src/intrinsics/numeric/aint.md:16 #: ../../doc/src/intrinsics/numeric/anint.md:16 @@ -3374,36 +3415,37 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/erfc.md:16 #: ../../doc/src/intrinsics/numeric/floor.md:16 msgid "`x` the input value must be of type real." -msgstr "" +msgstr "`x` ,输入值必须是实数类型。" #: ../../doc/src/intrinsics/numeric/aint.md:18 #: ../../doc/src/intrinsics/numeric/anint.md:18 msgid "`kind` the optional input parameter initialises the kind of the result." -msgstr "" +msgstr "`kind` 可选的输入参数,初始化结果的种类。" #: ../../doc/src/intrinsics/numeric/aint.md:22 #: ../../doc/src/intrinsics/numeric/anint.md:22 msgid "" "The return value is of type integer(kind) if kind is passed as input " "parameter. If not, default kind real is returned." -msgstr "" +msgstr "如果 kind 作为输入参数传递,则返回值是 integer(kind) 类型。如果不是," +"则返回默认类型 real。" #: ../../doc/src/intrinsics/numeric/aint.md:25 msgid "" "The return value is equal to or nearest largest whole number greater than" " or equal to `x` not exceeding its magnitude." -msgstr "" +msgstr "返回值等于或最接近大于或等于 `x` 且不超过其大小的最大整数。" #: ../../doc/src/intrinsics/numeric/aint.md:30 msgid "" "**aint(x)** returns the nearest largest whole number greater than or " "equal to `x` not exceeding input value's magnitude." -msgstr "" +msgstr "**aint(x)** 返回大于或等于 `x` 且不超过输入值大小的最接近的最大整数。" #: ../../doc/src/intrinsics/numeric/aint.md:33 #: ../../doc/src/intrinsics/numeric/anint.md:36 msgid "The optional parameter `kind` specifies the kind of the result." -msgstr "" +msgstr "可选参数 `kind` ,指定结果的种类。" #: ../../doc/src/intrinsics/numeric/aint.md:37 #: ../../doc/src/intrinsics/numeric/anint.md:40 @@ -3413,82 +3455,82 @@ msgstr "" #: ../../doc/src/intrinsics/numeric/floor.md:35 #: ../../doc/src/intrinsics/numeric/gamma.md:40 msgid "Supported argument types is real." -msgstr "" +msgstr "支持的参数类型是实数。" #: ../../doc/src/intrinsics/numeric/aint.md:57 #: ../../doc/src/intrinsics/numeric/floor.md:85 msgid "[ceiling](ceiling.md), [mod](mod.md)." -msgstr "" +msgstr "[ceiling](ceiling.md), [mod](mod.md)." #: ../../doc/src/intrinsics/numeric/anint.md:1 msgid "anint(x, [kind]): Round to Nearest Whole Number" -msgstr "" +msgstr "anint(x, [kind]):四舍五入到最近的整数" #: ../../doc/src/intrinsics/numeric/anint.md:3 msgid "Round to nearest whole number." -msgstr "" +msgstr "四舍五入到最近的整数。" #: ../../doc/src/intrinsics/numeric/anint.md:25 msgid "The return value is equal to rounded whole number." -msgstr "" +msgstr "返回值等于四舍五入的整数。" #: ../../doc/src/intrinsics/numeric/anint.md:29 msgid "**anint(x)** calculates rounded value of input parameter `x`." -msgstr "" +msgstr "**anint(x)** 计算输入参数 `x` 的舍入值。" #: ../../doc/src/intrinsics/numeric/anint.md:31 msgid "" "If `x` is less than or equal to 0 i.e., if `x` is negative or 0, " "`anint(x)` returns `aint(x - 0.5)`." -msgstr "" +msgstr "如果`x` 小于或等于0,即如果`x` 是负数或0,`anint(x)` 返回`aint(x - 0.5)` 。" #: ../../doc/src/intrinsics/numeric/anint.md:34 msgid "If `x` is greater than 0, `anint(x)` returns `aint(x + 0.5)`." -msgstr "" +msgstr "如果`x` 大于0,`anint(x)` 返回`aint(x + 0.5)` 。" #: ../../doc/src/intrinsics/numeric/anint.md:60 msgid "[aint](aint.md)." -msgstr "" +msgstr "[aint](aint.md)。" #: ../../doc/src/intrinsics/numeric/ceiling.md:1 msgid "ceiling(x): Integer Ceiling" -msgstr "" +msgstr "ceiling(x):进一取整" #: ../../doc/src/intrinsics/numeric/ceiling.md:3 msgid "Integer ceiling function" -msgstr "" +msgstr "进一取整函数" #: ../../doc/src/intrinsics/numeric/ceiling.md:16 msgid "The input value `x` may be of type real or integer." -msgstr "" +msgstr "输入值 `x` 可以是实数或整数类型。" #: ../../doc/src/intrinsics/numeric/ceiling.md:20 msgid "The return value is of type integer and nearest greater integer." -msgstr "" +msgstr "返回值是整数类型和最接近它的更大整数。" #: ../../doc/src/intrinsics/numeric/ceiling.md:24 msgid "**ceiling(x)** returns the least integer greater than or equal to `x`." -msgstr "" +msgstr "**ceiling(x)** 返回大于或等于 `x` 的最小整数。" #: ../../doc/src/intrinsics/numeric/ceiling.md:28 msgid "Supported input parameter types are integer and real." -msgstr "" +msgstr "支持的输入参数类型是整数和实数。" #: ../../doc/src/intrinsics/numeric/ceiling.md:66 msgid "[floor](floor.md), [mod](mod.md)." -msgstr "" +msgstr "[floor](floor.md),[mod](mod.md)。" #: ../../doc/src/intrinsics/numeric/cmplx.md:1 msgid "cmplx(x [, [, kind]]): Convert to Complex" -msgstr "" +msgstr "cmplx(x [, [, kind]]):转换为复数" #: ../../doc/src/intrinsics/numeric/cmplx.md:3 msgid "Conversion to complex type." -msgstr "" +msgstr "转换为复数类型。" #: ../../doc/src/intrinsics/numeric/cmplx.md:14 msgid "`cmplx(x, y)` is one of the intrinsic present in ASR." -msgstr "" +msgstr "`cmplx(x, y)` 是 ASR 中的内置函数之一。" #: ../../doc/src/intrinsics/numeric/cmplx.md:18 msgid "" @@ -3498,367 +3540,377 @@ msgid "" "integer expression type for initialisation indicating the kind parameter " "of the result." msgstr "" +"`x` 输入值必须是整数、实数或复数。 `y` 可选输入值必须是整数或实数类型。" +"它应该只在 `x` 不是复数的情况下出现。 `kind` " +"用于初始化的整数表达式类型的可选输入值,指示结果的种类参数。" #: ../../doc/src/intrinsics/numeric/cmplx.md:26 msgid "" "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." -msgstr "" +msgstr "返回值是复数类型,类型由指定的输入`kind`类型定义。如果未指定 `kind`," +"则返回值为默认 `kind` `complex` 类型。" #: ../../doc/src/intrinsics/numeric/cmplx.md:32 msgid "" "**cmplx(x, [, y [, kind]])** converts the input value to complex " "representation:" -msgstr "" +msgstr "**cmplx(x, [, y [, kind]])** 将输入值转换为复数表示:" #: ../../doc/src/intrinsics/numeric/cmplx.md:34 msgid "" "`x` to real component of complex number. if `y` is present, it is " "converted to the imaginary component." -msgstr "" +msgstr "`x` 为复数的实部。如果 `y` 存在,则将其转换为虚部。" #: ../../doc/src/intrinsics/numeric/cmplx.md:37 msgid "If `y` is not present, the imaginary component is set to 0.0." -msgstr "" +msgstr "如果 `y` 不存在,则虚部设置为 0.0。" #: ../../doc/src/intrinsics/numeric/cmplx.md:39 msgid "If `x` is complex then `y` must not be present." -msgstr "" +msgstr "如果 `x` 是复数,则 `y` 不能出现。" #: ../../doc/src/intrinsics/numeric/cmplx.md:49 msgid "Supported argument types are integer, real, or complex." -msgstr "" +msgstr "支持的参数类型是整数、实数或复数。" #: ../../doc/src/intrinsics/numeric/conjg.md:1 msgid "conjg(x): Complex Conjugate" -msgstr "" +msgstr "conjg(x):复共轭" #: ../../doc/src/intrinsics/numeric/conjg.md:3 msgid "Complex conjugate function." -msgstr "" +msgstr "复共轭函数。" #: ../../doc/src/intrinsics/numeric/conjg.md:17 msgid "`x` the input value must be of type complex." -msgstr "" +msgstr "`x` 输入值必须是复数类型。" #: ../../doc/src/intrinsics/numeric/conjg.md:21 msgid "The return value is of complex type." -msgstr "" +msgstr "返回值是复数类型。" #: ../../doc/src/intrinsics/numeric/conjg.md:25 msgid "**conjg(x)** converts the input value `x` to its conjugate." -msgstr "" +msgstr "**conjg(x)** 将输入值 `x` 转换为其复数共轭。" #: ../../doc/src/intrinsics/numeric/conjg.md:29 msgid "$x + iy$ converted to $x - iy$" -msgstr "" +msgstr "$x + iy$ 转换为 $x - iy$" #: ../../doc/src/intrinsics/numeric/conjg.md:35 msgid "Supported argument types is complex." -msgstr "" +msgstr "支持的参数类型是复数。" #: ../../doc/src/intrinsics/numeric/digits.md:1 msgid "digits(x): Significant Binary Digits" -msgstr "" +msgstr "digits(x):有效二进制数字" #: ../../doc/src/intrinsics/numeric/digits.md:3 msgid "Significant binary digits." -msgstr "" +msgstr "有效的二进制数字。" #: ../../doc/src/intrinsics/numeric/digits.md:15 msgid "`x` the input value must be of type real or integer." -msgstr "" +msgstr "`x` 输入值必须是实数或整数类型。" #: ../../doc/src/intrinsics/numeric/digits.md:23 msgid "" "**digits(x)** returns the number of significant binary digits of the " "internal mopdel representation of `x`." -msgstr "" +msgstr "**digits(x)** 返回 `x` 的内部模型表示的有效二进制位数。" #: ../../doc/src/intrinsics/numeric/dim.md:1 msgid "dim(x, y): Positive Difference or 0" -msgstr "" +msgstr "dim(x, y):正差或 0" #: ../../doc/src/intrinsics/numeric/dim.md:3 msgid "Positive difference or 0." -msgstr "" +msgstr "正差或 0。" #: ../../doc/src/intrinsics/numeric/dim.md:15 msgid "" "`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`." -msgstr "" +msgstr "`x` 输入值必须是实数或整数类型。 `y` 输入值的类型和种类必须与 `x` 相同。" #: ../../doc/src/intrinsics/numeric/dim.md:20 msgid "The return value is of type integer or real." -msgstr "" +msgstr "返回值是整数或实数类型。" #: ../../doc/src/intrinsics/numeric/dim.md:24 msgid "" "**dim(x)** computes the difference $x - y$, if the result is positive, " "otherwise returns 0." -msgstr "" +msgstr "**dim(x)** 计算 $x - y$ 的差值,如果结果为正,否则返回 0。" #: ../../doc/src/intrinsics/numeric/epsilon.md:1 msgid "epsilon(x): Epsilon" -msgstr "" +msgstr "epsilon(x):ε 小量" #: ../../doc/src/intrinsics/numeric/epsilon.md:3 msgid "Epsilon function." -msgstr "" +msgstr "Epsilon 函数。" #: ../../doc/src/intrinsics/numeric/epsilon.md:20 msgid "The return value is of same type as of the input argument." -msgstr "" +msgstr "返回值与输入参数的类型相同。" #: ../../doc/src/intrinsics/numeric/epsilon.md:24 msgid "" "**epsilon(x)** computes the smallest number $\\epsilon$ of the same kind " "as `x` following:" -msgstr "" +msgstr "**epsilon(x)** 计算与 `x` 相同类型的最小数 $\\epsilon$,如下所示:" #: ../../doc/src/intrinsics/numeric/epsilon.md:27 msgid "$1 + \\epsilon > 1$" -msgstr "" +msgstr "$1 + \\epsilon > 1$" #: ../../doc/src/intrinsics/numeric/erf.md:1 msgid "erf(x): Error" -msgstr "" +msgstr "erf(x):误差函数" #: ../../doc/src/intrinsics/numeric/erf.md:3 msgid "Error function." -msgstr "" +msgstr "误差函数。" #: ../../doc/src/intrinsics/numeric/erf.md:20 msgid "" "The return value is of type real and of the same kind as of the input " "parameter `x`." -msgstr "" +msgstr "返回值是 real 类型,与输入参数 `x` 的类型相同。" #: ../../doc/src/intrinsics/numeric/erf.md:25 #: ../../doc/src/intrinsics/numeric/erfc.md:25 msgid "" "**erf(x)** computes the error function of `x`. The result lies in the " "range:" -msgstr "" +msgstr "**erf(x)** 计算 `x` 的误差函数。结果位于以下范围内:" #: ../../doc/src/intrinsics/numeric/erf.md:27 msgid "$-1 \\leq erf (x) \\leq 1$" -msgstr "" +msgstr "$-1 \\leq erf (x) \\leq 1$" #: ../../doc/src/intrinsics/numeric/erf.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" -msgstr "" +msgstr "$\\frac{2}{\\sqrt\\pi}\\int_0^xe^{-t^2}dt$" #: ../../doc/src/intrinsics/numeric/erf.md:69 msgid "[erfc](erfc.md)." -msgstr "" +msgstr "[erfc](erfc.md)." #: ../../doc/src/intrinsics/numeric/erfc.md:1 msgid "erfc(x): Complementary Error" -msgstr "" +msgstr "erfc(x):互补误差" #: ../../doc/src/intrinsics/numeric/erfc.md:3 msgid "Complementary error function." -msgstr "" +msgstr "互补误差函数。" #: ../../doc/src/intrinsics/numeric/erfc.md:20 msgid "" "The return value is of type real and of the same kind as of the input " "parameter `x`. `erfc(x)` returns $1 - erf(x)$." -msgstr "" +msgstr "返回值是 real 类型,与输入参数 `x` 的类型相同。 `erfc(x)` 返回 $1 - erf(x)$。" #: ../../doc/src/intrinsics/numeric/erfc.md:27 msgid "$0 \\leq erf (x) \\leq 2$" -msgstr "" +msgstr "$0 \\leq erf (x) \\leq 2$" #: ../../doc/src/intrinsics/numeric/erfc.md:31 msgid "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" -msgstr "" +msgstr "$\\frac{2}{\\sqrt\\pi}\\int_{x}^{\\infty}e^{-t^2}dt$" #: ../../doc/src/intrinsics/numeric/erfc.md:33 msgid "" "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." -msgstr "" +msgstr "它用于在相对精度损失较大的情况下,如果为较大的 `x` 调用 `erf(x)` 并且从 1 " +"中减去结果。" #: ../../doc/src/intrinsics/numeric/erfc.md:72 msgid "[erf](erf.md)." -msgstr "" +msgstr "[erf](erf.md)." #: ../../doc/src/intrinsics/numeric/exp.md:1 msgid "exp(x): Exponential" -msgstr "" +msgstr "exp(x):指数函数" #: ../../doc/src/intrinsics/numeric/exp.md:3 msgid "Exponential function." -msgstr "" +msgstr "指数函数。" #: ../../doc/src/intrinsics/numeric/exp.md:16 msgid "`x` the input value must be of type real or complex." -msgstr "" +msgstr "`x` 输入值必须是实数或复数类型。" #: ../../doc/src/intrinsics/numeric/exp.md:20 msgid "The return value is of same type as of the input argument, `x`." -msgstr "" +msgstr "返回值与输入参数 `x` 的类型相同。" #: ../../doc/src/intrinsics/numeric/exp.md:24 msgid "**exp(x)** computes the base $e$ exponential of `x`, i.e., $e^x$." -msgstr "" +msgstr "**exp(x)** 计算 `x` 的基本 $e$ 指数,即 $e^x$。" #: ../../doc/src/intrinsics/numeric/exp.md:26 msgid "" "If `x` is of type complex, its imaginary part is considered as a value in" " radians." -msgstr "" +msgstr "如果 `x` 是复数类型,它的虚部被认为是弧度值。" #: ../../doc/src/intrinsics/numeric/exp.md:31 msgid "Supported argument types is real and complex." -msgstr "" +msgstr "支持的参数类型是实数或复数。" #: ../../doc/src/intrinsics/numeric/floor.md:1 msgid "floor(x, kind): Integer Floor" -msgstr "" +msgstr "floor(x, kind):去一取整" #: ../../doc/src/intrinsics/numeric/floor.md:3 msgid "Integer floor function." -msgstr "" +msgstr "去一取整函数。" #: ../../doc/src/intrinsics/numeric/floor.md:18 msgid "" "`kind` the optional input parameter must be a scalar integer constant " "expression." -msgstr "" +msgstr "`kind` 可选输入参数必须是一个标量整数常量表达式。" #: ../../doc/src/intrinsics/numeric/floor.md:22 msgid "" "The return value is of type integer(kind) if kind is passed as input " "parameter. If not, default kind integer is returned." -msgstr "" +msgstr "如果 kind 作为输入参数传递,则返回值是 integer(kind) " +"类型。如果不是,则返回默认类型整数。" #: ../../doc/src/intrinsics/numeric/floor.md:25 msgid "" "The return value is equal to or nearest greatest integer less than or " "equal to `x`." -msgstr "" +msgstr "返回值等于或最接近小于或等于 `x` 的最大整数。" #: ../../doc/src/intrinsics/numeric/floor.md:30 msgid "" "**floor(x)** returns the greatest integer less than or equal to x. It " "returns an integer value unless spefically specified using second " "optional paramter." -msgstr "" +msgstr "**floor(x)** 返回小于或等于 x " +"的最大整数。它返回一个整数值,除非使用第二个可选参数特别指定。" #: ../../doc/src/intrinsics/numeric/gamma.md:1 msgid "gamma(x): Gamma" -msgstr "" +msgstr "gamma(x):伽马函数" #: ../../doc/src/intrinsics/numeric/gamma.md:3 msgid "Gamma function." -msgstr "" +msgstr "伽马函数。" #: ../../doc/src/intrinsics/numeric/gamma.md:16 msgid "" "`x` the input value must be of type real. It should not be zero or a " "negative integer." -msgstr "" +msgstr "`x` 输入值必须是实数类型。它不应为零或负整数。" #: ../../doc/src/intrinsics/numeric/gamma.md:21 msgid "The return value is of same type and kind as of `x`." -msgstr "" +msgstr "返回值与 `x` 的类型和种类相同。" #: ../../doc/src/intrinsics/numeric/gamma.md:25 msgid "" "**gamma(x)** computes $\\gamma(x)$. For positive, integer value of `x`, " "the Gamma function simplifies to factorial function:" -msgstr "" +msgstr "**gamma(x)** 计算 $\\gamma(x)$。对于 `x` 的正整数值,Gamma " +"函数简化为阶乘函数:" #: ../../doc/src/intrinsics/numeric/gamma.md:28 msgid "$\\gamma(x) = (x-1)!$" -msgstr "" +msgstr "$\\gamma(x) = (x-1)!$" #: ../../doc/src/intrinsics/numeric/gamma.md:30 msgid "In general, if $x > 0$:" -msgstr "" +msgstr "一般来说,如果 $x > 0$:" #: ../../doc/src/intrinsics/numeric/gamma.md:32 msgid "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" -msgstr "" +msgstr "$\\gamma(x) = \\int_{0}^{\\infty} e^{-t} dt$" #: ../../doc/src/intrinsics/numeric/gamma.md:34 msgid "and if $-n-1 < x < -n$ where n is an integer >= 0:" -msgstr "" +msgstr "如果 $-n-1 < x < -n$ 其中 n 是整数 >= 0:" #: ../../doc/src/intrinsics/numeric/gamma.md:36 msgid "" "$\\gamma(x) = \\int_{0}^{\\infty}(e ^{-t} - \\sum\\limits_{k=0}^n " "\\frac{(-t)^k}{k!} dt)$" msgstr "" +"$\\gamma(x) = \\int_{0}^{\\infty}(e ^{-t} - \\sum\\limits_{k=0}^n \\frac" +"{(-t)^k}{k!} dt)$" #: ../../doc/src/intrinsics/numeric/gamma.md:76 msgid "[epsilon](epsilon.md)" -msgstr "" +msgstr "[epsilon](epsilon.md)" #: ../../doc/src/intrinsics/numeric/mod.md:1 msgid "mod(x, y): Modulus" -msgstr "" +msgstr "mod(x, y):模数" #: ../../doc/src/intrinsics/numeric/mod.md:3 msgid "Modulus or remainder function." -msgstr "" +msgstr "模数或余数函数。" #: ../../doc/src/intrinsics/numeric/mod.md:17 msgid "`x` the input value, can be integer or real." -msgstr "" +msgstr "`x` 输入值,可以是整数或实数。" #: ../../doc/src/intrinsics/numeric/mod.md:19 msgid "" "`y` second input parameter should be same type and kind as `x` and not " "equal to 0." -msgstr "" +msgstr "`y` 第二个输入参数的类型和种类应与 `x` 相同且不等于 0。" #: ../../doc/src/intrinsics/numeric/mod.md:24 msgid "" "The return value is of type and kind same as of `x`. The result is " "calculated using mathematical modulo or remainder as:" -msgstr "" +msgstr "返回值的类型和种类与 `x` 相同。结果使用数学模或余数计算为:" #: ../../doc/src/intrinsics/numeric/mod.md:27 msgid "`x - INT (x / y) * y`." -msgstr "" +msgstr "`x - INT (x / y) * y`." #: ../../doc/src/intrinsics/numeric/mod.md:29 msgid "If `y` is 0, the result is undefined like `any integer value / 0`." -msgstr "" +msgstr "如果 `y` 为 0,则结果未定义,如 `any integer value / 0`。" #: ../../doc/src/intrinsics/numeric/mod.md:33 msgid "" "**mod(x, y)** calculates and returns modulo or remainder when `x` is " "divided by `y`. The result is calculated using" -msgstr "" +msgstr "**mod(x, y)** 当 `x` 除以 `y` 时计算并返回模数或余数。结果计算使用" #: ../../doc/src/intrinsics/numeric/mod.md:36 msgid "`x - INT(x / y) * y`" -msgstr "" +msgstr "`x - INT(x / y) * y`" #: ../../doc/src/intrinsics/numeric/mod.md:38 msgid "" "i.e., result is remainder when first argument is mathematically divided " "by second argument." -msgstr "" +msgstr "即,当第一个参数在数学上除以第二个参数时,结果是余数。" #: ../../doc/src/intrinsics/numeric/mod.md:41 msgid "The return value should be less than `y`." -msgstr "" +msgstr "返回值应该小于`y`。" #: ../../doc/src/language.md:1 msgid "Fortran Language" -msgstr "" +msgstr "Fortran 语言" #: ../../doc/src/language.md:3 msgid "Background and Motivation" -msgstr "" +msgstr "背景和动机" #: ../../doc/src/language.md:5 msgid "" @@ -3870,35 +3922,39 @@ msgid "" "may or may not be well optimized or maintained, at present or down the " "road." msgstr "" +"Fortran 的设计从一开始就自然而简单地将数学转换为以最高速度编译和运行的代码。" +"并且专门针对此类基本计算任务,它在语言本身中包含广泛的关键功能,在所有平台上" +"都是标准的,不需要目前或未来可能会或可能不会得到很好优化或维护的外部库路。" #: ../../doc/src/language.md:12 msgid "Some highlights:" -msgstr "" +msgstr "一些亮点:" #: ../../doc/src/language.md:14 msgid "" "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);" -msgstr "" +msgstr "多维数组,可以根据数学/科学的要求进行分配和索引(不限于从 0 或 1 " +"开始),并且可以根据需要进行切片(例如,在 MATLAB 中);" #: ../../doc/src/language.md:17 msgid "" "Operators which operate naturally upon the aforementioned " "arrays/matrices, as they do scalars;" -msgstr "" +msgstr "像对标量一样自然地对上述数组/矩阵进行操作的运算符;" #: ../../doc/src/language.md:19 msgid "Complex numbers;" -msgstr "" +msgstr "复数;" #: ../../doc/src/language.md:20 msgid "Special functions;" -msgstr "" +msgstr "特殊函数;" #: ../../doc/src/language.md:21 msgid "Structures and pointers for more general data representation." -msgstr "" +msgstr "用于更通用数据表示的结构和指针。" #: ../../doc/src/language.md:23 msgid "" @@ -3910,26 +3966,34 @@ msgid "" " as well as highly optimized executables, directly from natural, readable" " code without need of extensive optimization heroics by the developer." msgstr "" +"因为基本内容包含在语言本身中,所以阅读和编写都很简单,无需从大量的外部类中进" +"行选择或破译来做同样的事情。由于这些要素是自包含的,编译器可以直接从自然、可" +"读的代码中提供详细的编译时(例如,参数不匹配)和运行时(例如,内存访问)检查" +",以及高度优化的可执行文件。开发人员的广泛优化英雄。" #: ../../doc/src/language.md:31 msgid "See our blog posts for more information:" -msgstr "" +msgstr "有关更多信息,请参阅我们的博客文章:" #: ../../doc/src/language.md:33 msgid "" "[Why We Created LFortran](https://lfortran.org/blog/2019/04/why-we-" "created-lfortran/)" msgstr "" +"[我们为什么创建 LFortran](https://lfortran.org/blog/2019/04/" +"why-we-created-lfortran/)" #: ../../doc/src/language.md:34 msgid "" "[Why to Use Fortran For New Projects](https://lfortran.org/blog/2019/05" "/why-to-use-fortran-for-new-projects/)" msgstr "" +"[为什么在新项目中使用 Fortran](https://lfortran.org/blog/2019/05/" +"why-to-use-fortran-for-new-projects/)" #: ../../doc/src/language.md:36 msgid "How to Learn Fortran" -msgstr "" +msgstr "如何学习 Fortran" #: ../../doc/src/language.md:38 msgid "" @@ -3940,6 +4004,10 @@ msgid "" "side comparison with Python/NumPy, links to other online Fortran " "resources and books, and an FAQ." msgstr "" +"Fortran 学习起来相对较快,因为它比 C/C++ " +"简单得多,也更小(实际上,包括所有需要的库)。如果你有兴趣了解更多信息," +"请参阅我们的网页 [fortran90.org],其中包含编写代码的推荐做法、与 Python/" +"NumPy 的并排比较、其他在线 Fortran 资源和书籍的链接以及常见问题解答。" #: ../../doc/src/progress.md:3 msgid "" @@ -3947,32 +4015,35 @@ msgid "" "each feature we list a short description, the filename with the test and " "current status for each parts of the compiler:" msgstr "" +"此页面记录了 LFortran 支持的 Fortran 功能。对于每个特性,我们列出了一个简短的" +"描述,以及编译器每个部分的测试和当前状态的文件名:" #: ../../doc/src/progress.md:7 msgid "AST: The code can be parsed to AST (`lfortran --show-ast test.f90`)" -msgstr "" +msgstr "AST:代码可以解析为 AST (`lfortran --show-ast test.f90`)" #: ../../doc/src/progress.md:8 msgid "ASR: The code can be transformed to ASR (`lfortran --show-asr test.f90`)" -msgstr "" +msgstr "ASR:代码可以转换为 ASR (`lfortran --show-asr test.f90`)" #: ../../doc/src/progress.md:9 msgid "LLVM: LFortran can generate LLVM IR (`lfortran --show-llvm test.f90`)" -msgstr "" +msgstr "LLVM:LFortran 可以生成 LLVM IR (`lfortran --show-llvm test.f90`)" #: ../../doc/src/progress.md:10 msgid "BIN: The LLVM IR can compile to a binary" -msgstr "" +msgstr "BIN:LLVM IR 可以编译为二进制文件" #: ../../doc/src/progress.md:11 msgid "RUN: The binary runs without errors" -msgstr "" +msgstr "RUN:二进制运行没有错误" #: ../../doc/src/progress.md:13 msgid "" "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." -msgstr "" +msgstr "如果全部为绿色,则表示该功能完全有效,你可以在代码中使用它。否则,你可以查看" +"每个功能的状态。" #: ../../doc/src/progress.md:16 msgid "" @@ -3983,614 +4054,732 @@ msgid "" "Our goal is to have a comprehensive Fortran testsuite that can be used to" " test any Fortran compiler." msgstr "" +"此页面是使用 [Compiler Tester](https://gitlab.com/lfortran/compiler_tester) " +"存储库自动生成的,该存储库包含所有 Fortran 测试和脚本,用于运行 LFortran " +"以生成下表。我们正在寻找贡献者来贡献更多的测试。我们的目标是拥有一个全面的 " +"Fortran 测试套件,可用于测试任何 Fortran 编译器。" #: ../../doc/src/progress.md:23 msgid "Testing the LFortran compiler version:" -msgstr "" +msgstr "测试 LFortran 编译器版本:" #: ../../doc/src/progress.md:32 msgid "Topics" -msgstr "" +msgstr "话题" #: ../../doc/src/progress.md:34 msgid "Full programs that compute something interesting" -msgstr "" +msgstr "计算有趣事物的完整程序" #: ../../doc/src/progress.md:36 msgid "Basic Numerics" -msgstr "" +msgstr "基本数值" #: ../../doc/src/progress.md:38 msgid "Directory: `tests/programs/numerics`" -msgstr "" +msgstr "路径:`tests/programs/numerics`" #: ../../doc/src/progress.md msgid "LLVM" -msgstr "" +msgstr "LLVM" #: ../../doc/src/progress.md msgid "BIN" -msgstr "" +msgstr "BIN" #: ../../doc/src/progress.md msgid "RUN" -msgstr "" +msgstr "RUN" #: ../../doc/src/progress.md msgid "Filename" -msgstr "" +msgstr "文件名" #: ../../doc/src/progress.md msgid "`Pure Fortran sin(x) implementation`" -msgstr "" +msgstr "`纯 Fortran sin(x) 实现`" #: ../../doc/src/progress.md msgid "✅" -msgstr "" +msgstr "✅" #: ../../doc/src/progress.md msgid "[t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/programs/numerics/t01_sin_implementation.f90)" msgstr "" +"[t01_sin_implementation.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/programs/numerics/t01_sin_implementation.f90)" #: ../../doc/src/progress.md:45 msgid "Modules" -msgstr "" +msgstr "模块" #: ../../doc/src/progress.md:47 msgid "Basic Usage" -msgstr "" +msgstr "基本用法" #: ../../doc/src/progress.md:49 msgid "Directory: `tests/modules/basic`" -msgstr "" +msgstr "路径:`tests/modules/basic`" #: ../../doc/src/progress.md msgid "`Basic modules`" -msgstr "" +msgstr "`基本模块`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/basic/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/basic/t01.f90)" #: ../../doc/src/progress.md:56 msgid "Module Functions and Subroutines" -msgstr "" +msgstr "模块函数和子程序" #: ../../doc/src/progress.md:58 msgid "Directory: `tests/modules/procedures`" -msgstr "" +msgstr "路径:`tests/modules/procedures`" #: ../../doc/src/progress.md msgid "`Module functions`" -msgstr "" +msgstr "`模块函数`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t01.f90)" #: ../../doc/src/progress.md msgid "`Module subroutines`" -msgstr "" +msgstr "`模块子程序`" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t02.f90)" msgstr "" +"[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t02.f90)" #: ../../doc/src/progress.md msgid "`Nested subroutines`" -msgstr "" +msgstr "`嵌套子程序`" #: ../../doc/src/progress.md msgid "[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/modules/procedures/t03.f90)" msgstr "" +"[t03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"modules/procedures/t03.f90)" #: ../../doc/src/progress.md:67 msgid "Expressions" -msgstr "" +msgstr "表达式" #: ../../doc/src/progress.md:69 msgid "Arithmetic Operations" -msgstr "" +msgstr "算术运算" #: ../../doc/src/progress.md:71 msgid "Directory: `tests/expressions/arit`" -msgstr "" +msgstr "路径:`tests/expressions/arit`" #: ../../doc/src/progress.md msgid "`+,-,*,/,**`" -msgstr "" +msgstr "`+,-,*,/,**`" #: ../../doc/src/progress.md msgid "[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/arit/basic_operations.f90)" msgstr "" +"[basic_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/arit/basic_operations.f90)" #: ../../doc/src/progress.md:78 msgid "Integers" -msgstr "" +msgstr "整型" #: ../../doc/src/progress.md:80 msgid "Directory: `tests/expressions/integers`" -msgstr "" +msgstr "路径:`tests/expressions/integers`" #: ../../doc/src/progress.md msgid "`integers`" -msgstr "" +msgstr "`整型`" #: ../../doc/src/progress.md msgid "[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/integer_kind.f90)" msgstr "" +"[integer_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/integers/integer_kind.f90)" #: ../../doc/src/progress.md msgid "`relational operations`" -msgstr "" +msgstr "`关系运算`" #: ../../doc/src/progress.md msgid "[t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t01_rel_operations.f90)" msgstr "" +"[t01_rel_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/integers/t01_rel_operations.f90)" #: ../../doc/src/progress.md msgid "`logical operations`" -msgstr "" +msgstr "`逻辑运算`" #: ../../doc/src/progress.md msgid "[t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/integers/t02_logical_operations.f90)" msgstr "" +"[t02_logical_operations.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/expressions/integers/t02_logical_operations.f90)" #: ../../doc/src/progress.md:89 msgid "Real Numbers" -msgstr "" +msgstr "实数" #: ../../doc/src/progress.md:91 msgid "Directory: `tests/expressions/reals`" -msgstr "" +msgstr "路径:`tests/expressions/reals`" #: ../../doc/src/progress.md msgid "`single/double reals`" -msgstr "" +msgstr "`单/双精度实数`" #: ../../doc/src/progress.md msgid "[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/real_kind.f90)" msgstr "" +"[real_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/reals/real_kind.f90)" #: ../../doc/src/progress.md msgid "`defined operator`" -msgstr "" +msgstr "`定义的运算符`" #: ../../doc/src/progress.md msgid "❌" -msgstr "" +msgstr "❌" #: ../../doc/src/progress.md msgid "[t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/reals/t01_def_op.f90)" msgstr "" +"[t01_def_op.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/reals/t01_def_op.f90)" #: ../../doc/src/progress.md:99 msgid "Complex Numbers" -msgstr "" +msgstr "复数" #: ../../doc/src/progress.md:101 msgid "Directory: `tests/expressions/complex`" -msgstr "" +msgstr "路径:`tests/expressions/complex`" #: ../../doc/src/progress.md msgid "`single/double complex`" -msgstr "" +msgstr "`单/双复数`" #: ../../doc/src/progress.md msgid "[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/complex/complex_kind.f90)" msgstr "" +"[complex_kind.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/expressions/complex/complex_kind.f90)" #: ../../doc/src/progress.md:108 msgid "Strings" -msgstr "" +msgstr "字符串" #: ../../doc/src/progress.md:110 msgid "Directory: `tests/expressions/character`" -msgstr "" +msgstr "路径:`tests/expressions/character`" #: ../../doc/src/progress.md msgid "`character`" -msgstr "" +msgstr "`字符`" #: ../../doc/src/progress.md msgid "[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t01_character.f90)" msgstr "" +"[t01_character.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/character/t01_character.f90)" #: ../../doc/src/progress.md msgid "`string concatenation`" -msgstr "" +msgstr "`字符串连接`" #: ../../doc/src/progress.md msgid "[t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/character/t02_concat_operation.f90)" msgstr "" +"[t02_concat_operation.f90](https://gitlab.com/lfortran/compiler_tester/-/" +"blob/master/tests/expressions/character/t02_concat_operation.f90)" #: ../../doc/src/progress.md:118 msgid "Derived Types" -msgstr "" +msgstr "派生类型" #: ../../doc/src/progress.md:120 msgid "Directory: `tests/expressions/derived_type`" -msgstr "" +msgstr "路径:`tests/expressions/derived_type`" #: ../../doc/src/progress.md msgid "`basic derived types`" -msgstr "" +msgstr "`基本派生类型`" #: ../../doc/src/progress.md msgid "[t01_derived_type.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/expressions/derived_type/t01_derived_type.f90)" msgstr "" +"[t01_derived_type.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/expressions/derived_type/t01_derived_type.f90)" #: ../../doc/src/progress.md:127 msgid "Statements" -msgstr "" +msgstr "声明" #: ../../doc/src/progress.md:129 msgid "Allocate Statement" -msgstr "" +msgstr "分配语句" #: ../../doc/src/progress.md:131 msgid "Directory: `tests/statements/allocate`" -msgstr "" +msgstr "路径:`tests/statements/allocate`" #: ../../doc/src/progress.md msgid "`allocate statement`" -msgstr "" +msgstr "`分配语句`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/allocate/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/allocate/t01.f90)" #: ../../doc/src/progress.md:138 msgid "Block Statement" -msgstr "" +msgstr "块语句" #: ../../doc/src/progress.md:140 msgid "Directory: `tests/statements/block`" -msgstr "" +msgstr "路径:`tests/statements/block`" #: ../../doc/src/progress.md msgid "`block statement`" -msgstr "" +msgstr "`块语句`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/block/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/block/t01.f90)" #: ../../doc/src/progress.md:147 msgid "Goto Statement" -msgstr "" +msgstr "转到语句" #: ../../doc/src/progress.md:149 msgid "Directory: `tests/statements/goto`" -msgstr "" +msgstr "路径:`tests/statements/goto`" #: ../../doc/src/progress.md msgid "`computed go-to statement`" -msgstr "" +msgstr "`计算的首选语句`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/goto/t01.f90)" #: ../../doc/src/progress.md msgid "`go-to statement`" -msgstr "" +msgstr "`首选声明`" #: ../../doc/src/progress.md msgid "[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/goto/t02.f90)" msgstr "" +"[t02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/goto/t02.f90)" #: ../../doc/src/progress.md:157 msgid "If Statement" -msgstr "" +msgstr "如果语句" #: ../../doc/src/progress.md:159 msgid "Directory: `tests/statements/if`" -msgstr "" +msgstr "路径:`tests/statements/if`" #: ../../doc/src/progress.md msgid "`Test .false.`" -msgstr "" +msgstr "`Test .false.`" #: ../../doc/src/progress.md msgid "[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_01.f90)" msgstr "" +"[if_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_01.f90)" #: ../../doc/src/progress.md msgid "`single line if statement`" -msgstr "" +msgstr "`单行 if 语句`" #: ../../doc/src/progress.md msgid "[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_02.f90)" msgstr "" +"[if_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_02.f90)" #: ../../doc/src/progress.md msgid "`multi line if statement`" -msgstr "" +msgstr "`多行 if 语句`" #: ../../doc/src/progress.md msgid "[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_03.f90)" msgstr "" +"[if_03.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_03.f90)" #: ../../doc/src/progress.md msgid "`nested if statements`" -msgstr "" +msgstr "`嵌套的 if 语句`" #: ../../doc/src/progress.md msgid "[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/if/if_04.f90)" msgstr "" +"[if_04.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/if/if_04.f90)" #: ../../doc/src/progress.md:169 msgid "While Statement" -msgstr "" +msgstr "While 语句" #: ../../doc/src/progress.md:171 msgid "Directory: `tests/statements/while`" -msgstr "" +msgstr "路径:`tests/statements/while`" #: ../../doc/src/progress.md msgid "`Simple while loops`" -msgstr "" +msgstr "`简单的 while 循环`" #: ../../doc/src/progress.md msgid "[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_01.f90)" msgstr "" +"[while_01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/statements/while/while_01.f90)" #: ../../doc/src/progress.md msgid "`exit / cycle in while loops`" -msgstr "" +msgstr "`从 while 循环退出/跳过`" #: ../../doc/src/progress.md msgid "[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/while/while_02.f90)" msgstr "" +"[while_02.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/" +"tests/statements/while/while_02.f90)" #: ../../doc/src/progress.md:179 msgid "Print Statement" -msgstr "" +msgstr "Print 声明" #: ../../doc/src/progress.md:181 msgid "Directory: `tests/statements/print`" -msgstr "" +msgstr "路径:`tests/statements/print`" #: ../../doc/src/progress.md msgid "`Basic print`" -msgstr "" +msgstr "`基本 Print`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/print/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/print/t01.f90)" #: ../../doc/src/progress.md:188 msgid "Open, Read, Write, Close Statement" -msgstr "" +msgstr "Open、Read、Write、Close语句" #: ../../doc/src/progress.md:190 msgid "Directory: `tests/statements/file_io`" -msgstr "" +msgstr "路径:`tests/statements/file_io`" #: ../../doc/src/progress.md msgid "`open/read/write/close`" -msgstr "" +msgstr "`open/read/write/close`" #: ../../doc/src/progress.md msgid "[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/statements/file_io/t01.f90)" msgstr "" +"[t01.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/" +"statements/file_io/t01.f90)" #: ../../doc/src/progress.md:197 msgid "Intrinsic Functions" -msgstr "" +msgstr "内置函数" #: ../../doc/src/progress.md:199 msgid "abs" -msgstr "" +msgstr "abs" #: ../../doc/src/progress.md:201 msgid "Directory: `tests/intrinsic/abs`" -msgstr "" +msgstr "路径:`tests/intrinsic/abs`" #: ../../doc/src/progress.md msgid "`scalar single/double real`" -msgstr "" +msgstr "`scalar single/double real`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "`scalar single/double complex`" -msgstr "" +msgstr "`scalar single/double complex`" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "`array 1D single/double real`" -msgstr "" +msgstr "`array 1D single/double real`" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/abs/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/abs/t03_array1d_real.f90)" #: ../../doc/src/progress.md:210 msgid "exp" -msgstr "" +msgstr "exp" #: ../../doc/src/progress.md:212 msgid "Directory: `tests/intrinsic/exp`" -msgstr "" +msgstr "路径:`tests/intrinsic/exp`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/exp/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/exp/t03_array1d_real.f90)" #: ../../doc/src/progress.md:221 msgid "log" -msgstr "" +msgstr "log" #: ../../doc/src/progress.md:223 msgid "Directory: `tests/intrinsic/log`" -msgstr "" +msgstr "路径:`tests/intrinsic/log`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/log/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/log/t03_array1d_real.f90)" #: ../../doc/src/progress.md:232 msgid "sqrt" -msgstr "" +msgstr "sqrt" #: ../../doc/src/progress.md:234 msgid "Directory: `tests/intrinsic/sqrt`" -msgstr "" +msgstr "路径:`tests/intrinsic/sqrt`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sqrt/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sqrt/t03_array1d_real.f90)" #: ../../doc/src/progress.md:243 msgid "sin" -msgstr "" +msgstr "sin" #: ../../doc/src/progress.md:245 msgid "Directory: `tests/intrinsic/sin`" -msgstr "" +msgstr "路径:`tests/intrinsic/sin`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sin/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sin/t03_array1d_real.f90)" #: ../../doc/src/progress.md:254 msgid "cos" -msgstr "" +msgstr "cos" #: ../../doc/src/progress.md:256 msgid "Directory: `tests/intrinsic/cos`" -msgstr "" +msgstr "路径:`tests/intrinsic/cos`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cos/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cos/t03_array1d_real.f90)" #: ../../doc/src/progress.md:265 msgid "tan" -msgstr "" +msgstr "tan" #: ../../doc/src/progress.md:267 msgid "Directory: `tests/intrinsic/tan`" -msgstr "" +msgstr "路径:`tests/intrinsic/tan`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tan/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tan/t03_array1d_real.f90)" #: ../../doc/src/progress.md:276 msgid "sinh" -msgstr "" +msgstr "sinh" #: ../../doc/src/progress.md:278 msgid "Directory: `tests/intrinsic/sinh`" -msgstr "" +msgstr "路径:`tests/intrinsic/sinh`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/sinh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/sinh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:287 msgid "cosh" -msgstr "" +msgstr "cosh" #: ../../doc/src/progress.md:289 msgid "Directory: `tests/intrinsic/cosh`" -msgstr "" +msgstr "路径:`tests/intrinsic/cosh`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/cosh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/cosh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:298 msgid "tanh" -msgstr "" +msgstr "tanh" #: ../../doc/src/progress.md:300 msgid "Directory: `tests/intrinsic/tanh`" -msgstr "" +msgstr "路径:`tests/intrinsic/tanh`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/tanh/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/tanh/t03_array1d_real.f90)" #: ../../doc/src/progress.md:309 msgid "asin" @@ -4598,19 +4787,25 @@ msgstr "asin" #: ../../doc/src/progress.md:311 msgid "Directory: `tests/intrinsic/asin`" -msgstr "" +msgstr "路径:`tests/intrinsic/asin`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/asin/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/asin/t03_array1d_real.f90)" #: ../../doc/src/progress.md:320 msgid "acos" @@ -4618,142 +4813,171 @@ msgstr "acos" #: ../../doc/src/progress.md:322 msgid "Directory: `tests/intrinsic/acos`" -msgstr "" +msgstr "路径:`tests/intrinsic/acos`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/acos/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/acos/t03_array1d_real.f90)" #: ../../doc/src/progress.md:331 msgid "atan" -msgstr "" +msgstr "atan" #: ../../doc/src/progress.md:333 msgid "Directory: `tests/intrinsic/atan`" -msgstr "" +msgstr "路径:`tests/intrinsic/atan`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t02_scalar_complex.f90)" msgstr "" +"[t02_scalar_complex.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t02_scalar_complex.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/atan/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/atan/t03_array1d_real.f90)" #: ../../doc/src/progress.md:342 msgid "modulo" -msgstr "" +msgstr "modulo" #: ../../doc/src/progress.md:344 msgid "Directory: `tests/intrinsic/modulo`" -msgstr "" +msgstr "路径:`tests/intrinsic/modulo`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/modulo/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/modulo/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/modulo/t03_array1d_real.f90)" #: ../../doc/src/progress.md:352 msgid "mod" -msgstr "" +msgstr "mod" #: ../../doc/src/progress.md:354 msgid "Directory: `tests/intrinsic/mod`" -msgstr "" +msgstr "路径:`tests/intrinsic/mod`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/mod/t01_scalar_real.f90)" #: ../../doc/src/progress.md msgid "[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/mod/t03_array1d_real.f90)" msgstr "" +"[t03_array1d_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/mod/t03_array1d_real.f90)" #: ../../doc/src/progress.md:362 msgid "min" -msgstr "" +msgstr "min" #: ../../doc/src/progress.md:364 msgid "Directory: `tests/intrinsic/min`" -msgstr "" +msgstr "路径:`tests/intrinsic/min`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/min/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/min/t01_scalar_real.f90)" #: ../../doc/src/progress.md:371 msgid "max" -msgstr "" +msgstr "max" #: ../../doc/src/progress.md:373 msgid "Directory: `tests/intrinsic/max`" -msgstr "" +msgstr "路径:`tests/intrinsic/max`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/max/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/max/t01_scalar_real.f90)" #: ../../doc/src/progress.md:380 msgid "int" -msgstr "" +msgstr "int" #: ../../doc/src/progress.md:382 msgid "Directory: `tests/intrinsic/int`" -msgstr "" +msgstr "路径:`tests/intrinsic/int`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/int/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/int/t01_scalar_real.f90)" #: ../../doc/src/progress.md:389 msgid "real" -msgstr "" +msgstr "real" #: ../../doc/src/progress.md:391 msgid "Directory: `tests/intrinsic/real`" -msgstr "" +msgstr "路径:`tests/intrinsic/real`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/real/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/real/t01_scalar_real.f90)" #: ../../doc/src/progress.md:398 msgid "floor" -msgstr "" +msgstr "floor" #: ../../doc/src/progress.md:400 msgid "Directory: `tests/intrinsic/floor`" -msgstr "" +msgstr "路径:`tests/intrinsic/floor`" #: ../../doc/src/progress.md msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/floor/t01_scalar_real.f90)" msgstr "" +"[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" +"master/tests/intrinsic/floor/t01_scalar_real.f90)" #: ../../doc/src/progress.md:407 msgid "nint" -msgstr "" +msgstr "nint" #: ../../doc/src/progress.md:409 msgid "Directory: `tests/intrinsic/nint`" -msgstr "" +msgstr "路径:`tests/intrinsic/nint`" #: ../../doc/src/progress.md -#, fuzzy msgid "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/master/tests/intrinsic/nint/t01_scalar_real.f90)" msgstr "" "[t01_scalar_real.f90](https://gitlab.com/lfortran/compiler_tester/-/blob/" diff --git a/integration_tests/data_01.f90 b/integration_tests/data_01.f90 index adf5cb98a9..a98f33e51a 100644 --- a/integration_tests/data_01.f90 +++ b/integration_tests/data_01.f90 @@ -1,7 +1,7 @@ program data_01 -integer :: x -real :: y, z, c1(4), bf1, xx90, xx95 -data x /1/ +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/ @@ -15,4 +15,6 @@ program data_01 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 diff --git a/integration_tests/intrinsics_03.f90 b/integration_tests/intrinsics_03.f90 index 96d810b046..6ae48f7869 100644 --- a/integration_tests/intrinsics_03.f90 +++ b/integration_tests/intrinsics_03.f90 @@ -1,8 +1,11 @@ program intrinsics_03 +use iso_fortran_env, only: dp => real64 real :: x - +real(dp) :: a, r1, r2 x = cos(9.5) - print *, x - +a = 4.2_dp +r1 = dcos(a) +r2 = -0.4902608213406995_dp +if (dabs(r1-r2) > 1e-15_dp) error stop end diff --git a/integration_tests/intrinsics_06.f90 b/integration_tests/intrinsics_06.f90 index 7c7a07de46..ae1994bcfd 100644 --- a/integration_tests/intrinsics_06.f90 +++ b/integration_tests/intrinsics_06.f90 @@ -10,6 +10,9 @@ program intrinsics_06 x = atan(1.5574077) print *, x +x = datan(1.5574077) +print *, x + x = asinh(1.1752012) print *, x diff --git a/integration_tests/intrinsics_19.f90 b/integration_tests/intrinsics_19.f90 index ab61f0924b..41d68978bd 100644 --- a/integration_tests/intrinsics_19.f90 +++ b/integration_tests/intrinsics_19.f90 @@ -61,5 +61,5 @@ program intrinsics_19 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 end diff --git a/integration_tests/intrinsics_22.f90 b/integration_tests/intrinsics_22.f90 index 42e95ccead..9301ba88b0 100644 --- a/integration_tests/intrinsics_22.f90 +++ b/integration_tests/intrinsics_22.f90 @@ -14,15 +14,21 @@ program intrinsics_22 j1b = max(-5, 3) real :: x1, x2 -real(dp) :: y1, y2 +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 diff --git a/integration_tests/sin_01.f90 b/integration_tests/sin_01.f90 index ae39b7a958..a8044e209e 100644 --- a/integration_tests/sin_01.f90 +++ b/integration_tests/sin_01.f90 @@ -1,7 +1,11 @@ program sin_01 use iso_fortran_env, only: dp => real64 implicit none -real(dp) :: x +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 diff --git a/run_tests.py b/run_tests.py index 84bb75d70b..91244203c8 100755 --- a/run_tests.py +++ b/run_tests.py @@ -23,6 +23,7 @@ def single_test(test, specific_test, verbose, no_llvm, update_reference): ast_openmp = test.get("ast_openmp", False) asr = test.get("asr", False) asr_implicit_typing = test.get("asr_implicit_typing", False) + asr_implicit_interface = test.get("asr_implicit_interface", False) asr_preprocess = test.get("asr_preprocess", False) asr_indent = test.get("asr_indent", False) mod_to_asr = test.get("mod_to_asr", False) @@ -137,6 +138,24 @@ def single_test(test, specific_test, verbose, no_llvm, update_reference): update_reference, extra_args) + if asr_implicit_interface: + if filename.endswith(".f"): + run_test( + filename, + "asr", + "lfortran --fixed-form --allow-implicit-interface --show-asr --no-color {infile} -o {outfile}", + filename, + update_reference, + extra_args) + else: + run_test( + filename, + "asr", + "lfortran --show-asr --allow-implicit-interface --no-color {infile} -o {outfile}", + filename, + update_reference, + extra_args) + if asr_preprocess: run_test( filename, diff --git a/src/bin/lfortran.cpp b/src/bin/lfortran.cpp index 8ffe798b0f..bbf3d73d89 100644 --- a/src/bin/lfortran.cpp +++ b/src/bin/lfortran.cpp @@ -1475,6 +1475,8 @@ int main(int argc, char *argv[]) app.add_option("--target", compiler_options.target, "Generate code for the given target")->capture_default_str(); app.add_flag("--print-targets", print_targets, "Print the registered targets"); app.add_flag("--implicit-typing", compiler_options.implicit_typing, "Allow implicit typing"); + app.add_flag("--allow-implicit-interface", compiler_options.implicit_interface, "Allow implicit interface"); + if( compiler_options.fast ) { lfortran_pass_manager.use_optimization_passes(); diff --git a/src/lfortran/mod_to_asr.cpp b/src/lfortran/mod_to_asr.cpp index 956d3e54a5..3de1ebbb30 100644 --- a/src/lfortran/mod_to_asr.cpp +++ b/src/lfortran/mod_to_asr.cpp @@ -55,14 +55,14 @@ int uncompress_gzip( } std::string extract_gzip( -#ifdef HAVE_ZLIB +#ifdef HAVE_ZLIB std::vector& buffer -#else +#else std::vector& /*buffer*/ #endif ) { -#ifdef HAVE_ZLIB +#ifdef HAVE_ZLIB std::vector data(1024*1024); uint64_t data_size = data.size(); int res = uncompress_gzip(&data[0], &data_size, &buffer[0], buffer.size()); @@ -292,7 +292,7 @@ ASR::TranslationUnit_t* parse_gfortran_mod_file(Allocator &al, const std::string nullptr, 0, nullptr, // return var ASR::abiType::GFortranModule, ASR::Public, - ASR::Interface, nullptr, false, false, false); + ASR::Interface, nullptr, false, false, false, false); s.p.proc = down_cast(asr); std::string sym_name = s.name; if (parent_scope->get_symbol(sym_name) != nullptr) { diff --git a/src/lfortran/parser/fixedform_tokenizer.cpp b/src/lfortran/parser/fixedform_tokenizer.cpp index 21df46dde9..a9ff2b1237 100644 --- a/src/lfortran/parser/fixedform_tokenizer.cpp +++ b/src/lfortran/parser/fixedform_tokenizer.cpp @@ -683,6 +683,27 @@ struct FixedFormRecursiveDescent { return false; } + bool is_function_call(unsigned char *&cur) { + if (!next_is(cur, "call")) return false; + auto cpy = cur; + auto next = cpy; next_line(next); + std::string cur_line{tostr(cpy, next)}; + // + std::string("call").size() + cpy += 4; + // function needs to start with a letter + if (*cpy <= 'a' || *cpy >= 'z') return false; + while(*cpy++ != '(') { + if (*cpy == '\n' || *cpy == '\0') + return false; + } + int32_t nesting = 1; + while(*cpy++ != '\n') { + if (*cpy == '(') nesting++; + if (*cpy == ')') nesting--; + } + return nesting == 0; + } + bool lex_body_statement(unsigned char *&cur) { eat_label(cur); if (lex_declaration(cur)) { @@ -698,23 +719,34 @@ struct FixedFormRecursiveDescent { lex_do(cur); return true; } + + if (is_function_call(cur)) { + tokenize_line("call", cur); + return true; + } + // assignment if (contains(cur, nline, '=')) { tokenize_line("", cur); return true; } - if (next_is(cur, "goto")) { + // `GOTO (X,Z,Y) M` translates to (roughly) + // `IF (M .EQ. 1) THEN; GOTO X; ELSE IF (M .EQ. 2) GOTO Z; IF (M .EQ. 3) GOTO Y; ENDIF` + if (next_is(cur, "goto(")) { + // lex_goto_select(cur); tokenize_line("", cur); return true; } - /* - * explicitly DO NOT tokenize `CONTINUE` - */ + // careful addition -- `IF` and `DO` terminals are `CONTINUE`, too + if (next_is(cur, "continue")) { + tokenize_line("continue", cur); + return true; + } - if (next_is(cur, "call") && !contains(cur, nline, '=')) { - tokenize_line("call", cur); + if (next_is(cur, "goto")) { + tokenize_line("goto", cur); return true; } @@ -748,6 +780,11 @@ struct FixedFormRecursiveDescent { return true; } + if (next_is(cur, "stop")) { + tokenize_line("stop", cur); + return true; + } + return false; } diff --git a/src/lfortran/semantics/ast_body_visitor.cpp b/src/lfortran/semantics/ast_body_visitor.cpp index a2f4bcc008..38fc00c3b2 100644 --- a/src/lfortran/semantics/ast_body_visitor.cpp +++ b/src/lfortran/semantics/ast_body_visitor.cpp @@ -883,12 +883,12 @@ class BodyVisitor : public CommonVisitor { } } - // We have to visit unit_decl_2 because in the example, the Template is directly inside the module and + // We have to visit unit_decl_2 because in the example, the Template is directly inside the module and // Template is a unit_decl_2 for (size_t i=0; i { } if (!original_sym) { original_sym = resolve_intrinsic_function(x.base.base.loc, sub_name); + if (!original_sym && compiler_options.implicit_interface) { + create_implicit_interface_function(x, sub_name, false); + original_sym = current_scope->resolve_symbol(sub_name); + LFORTRAN_ASSERT(original_sym!=nullptr); + } } ASR::symbol_t *sym = ASRUtils::symbol_get_past_external(original_sym); if (ASR::is_a(*sym)) { @@ -1259,6 +1264,11 @@ class BodyVisitor : public CommonVisitor { } break; } + case (ASR::symbolType::Variable) : { + final_sym=original_sym; + original_sym = nullptr; + break; + } default : { throw SemanticError("Symbol type not supported", x.base.base.loc); } @@ -1306,7 +1316,7 @@ class BodyVisitor : public CommonVisitor { if (!is_int && !is_real) { throw SemanticError("Arithmetic if (x) requires an integer or real for `x`", test_int->base.loc); } - ASR::expr_t *test_lt, *test_gt; + ASR::expr_t *test_lt, *test_gt; int kind = ASRUtils::extract_kind_from_ttype_t(test_int_type); if (is_int) { ASR::ttype_t *type0 = ASRUtils::TYPE( @@ -1557,7 +1567,47 @@ class BodyVisitor : public CommonVisitor { if (AST::is_a(*x.m_goto_label)) { int goto_label = AST::down_cast(x.m_goto_label)->m_n; tmp = ASR::make_GoTo_t(al, x.base.base.loc, goto_label); - } else { + + } else if (AST::is_a(*x.m_goto_label)) { + auto name = AST::down_cast(x.m_goto_label); + auto sym_name = std::string(name->m_id); + auto sym = current_scope->resolve_symbol(sym_name); + if (sym == nullptr) { + throw SemanticError("Cannot do `GOTO select` for undeclared variable", + x.base.base.loc); + } + if (!ASR::is_a(*sym)) { + throw SemanticError("Symbol needs to be a variable", + x.base.base.loc); + } + // n_labels GOTO + Vec a_body_vec; + a_body_vec.reserve(al, x.n_labels); + + // 1 label SELECT + Vec def_body; + def_body.reserve(al, 1); + + for (size_t i = 0; i < x.n_labels; ++i) { + if (!AST::is_a(*x.m_labels[i])) { + throw SemanticError("Can only `GOTO` integer labels", + x.base.base.loc); + } else { + auto l = AST::down_cast(x.m_labels[i]); // l->m_n gets the target -> if l->m_n == (i+1) ... + Vec body; + body.reserve(al, 1); + body.push_back(al, ASRUtils::STMT(ASR::make_GoTo_t(al, x.base.base.loc, l->m_n))); + Vec comparator_one; + comparator_one.reserve(al, 1); + ASR::ttype_t *int32_type = LFortran::ASRUtils::TYPE(ASR::make_Integer_t(al, x.base.base.loc, 4, nullptr, 0)); + comparator_one.push_back(al, LFortran::ASRUtils::EXPR(ASR::make_IntegerConstant_t(al, x.base.base.loc, i+1, int32_type))); + a_body_vec.push_back(al, ASR::down_cast(ASR::make_CaseStmt_t(al, x.base.base.loc, comparator_one.p, 1, body.p, 1))); + } + } + ASR::expr_t* target_var = ASRUtils::EXPR(ASR::make_Var_t(al, x.base.base.loc, sym)); + tmp = ASR::make_Select_t(al, x.base.base.loc, target_var, a_body_vec.p, + a_body_vec.size(), def_body.p, def_body.size()); + } else { throw SemanticError("A goto label must be an integer", x.base.base.loc); } diff --git a/src/lfortran/semantics/ast_common_visitor.h b/src/lfortran/semantics/ast_common_visitor.h index bf9aaba11d..5855d5a6a2 100644 --- a/src/lfortran/semantics/ast_common_visitor.h +++ b/src/lfortran/semantics/ast_common_visitor.h @@ -889,7 +889,9 @@ class CommonVisitor : public AST::BaseVisitor { ::AttrPrivate) { assgnd_access[sym] = ASR::accessType::Private; } else if (sa->m_attr == AST::simple_attributeType - ::AttrPublic) { + ::AttrPublic || sa->m_attr == AST::simple_attributeType + ::AttrParameter || sa->m_attr == AST::simple_attributeType + ::AttrExternal) { assgnd_access[sym] = ASR::accessType::Public; } else if (sa->m_attr == AST::simple_attributeType ::AttrOptional) { @@ -962,9 +964,9 @@ class CommonVisitor : public AST::BaseVisitor { throw SemanticError("Type mismatch during data initialization", x.base.base.loc); } - ASR::expr_t* value_value = ASRUtils::expr_value(value); - if (value_value) { - body.push_back(al, value_value); + ASR::expr_t* expression_value = ASRUtils::expr_value(value); + if (expression_value) { + body.push_back(al, expression_value); } else { throw SemanticError("The value in data must be a constant", x.base.base.loc); @@ -1005,9 +1007,16 @@ class CommonVisitor : public AST::BaseVisitor { // The `visit_expr` ensures it resolves as an expression // which must be a `Var_t` pointing to a `Variable_t`, // so no checks are needed: + ImplicitCastRules::set_converted_value(al, x.base.base.loc, &value, + ASRUtils::expr_type(value), ASRUtils::expr_type(object)); + ASR::expr_t* expression_value = ASRUtils::expr_value(value); + if (!expression_value) { + throw SemanticError("The value in data must be a constant", + x.base.base.loc); + } ASR::Var_t *v = ASR::down_cast(object); ASR::Variable_t *v2 = ASR::down_cast(v->m_v); - v2->m_value = value; + v2->m_value = expression_value; } } else { throw SemanticError("Attribute declaration not supported", @@ -1326,7 +1335,8 @@ class CommonVisitor : public AST::BaseVisitor { is_current_procedure_templated = true; type_param = true; type = LFortran::ASRUtils::TYPE(ASR::make_TypeParameter_t(al, loc, - s2c(al, derived_type_name), nullptr, 0)); + s2c(al, derived_type_name), nullptr, 0, + nullptr, 0)); } } } @@ -2501,6 +2511,62 @@ class CommonVisitor : public AST::BaseVisitor { return nullptr; } + template + void create_implicit_interface_function(const Call &x, std::string func_name, bool add_return) { + SymbolTable *parent_scope = current_scope; + current_scope = al.make_new(parent_scope); + + Vec c_args; + visit_expr_list(x.m_args, x.n_args, c_args); + + Vec args; + args.reserve(al, x.n_args); + std::string sym_name = to_lower(func_name); + for (size_t i=0; iadd_symbol(arg_name, ASR::down_cast(arg_var)); + args.push_back(al, LFortran::ASRUtils::EXPR(ASR::make_Var_t(al, x.base.base.loc, + current_scope->get_symbol(arg_name)))); + } + // currently hardcoding the return type to real-8 + ASR::ttype_t *type = LFortran::ASRUtils::TYPE(ASR::make_Real_t(al, x.base.base.loc, + 8, nullptr, 0)); + ASR::expr_t *to_return = nullptr; + if (add_return) { + std::string return_var_name = sym_name + "_return_var_name"; + ASR::asr_t *return_var = ASR::make_Variable_t(al, x.base.base.loc, + current_scope, s2c(al, return_var_name), LFortran::ASRUtils::intent_return_var, nullptr, nullptr, + ASR::storage_typeType::Default, type, + ASR::abiType::Source, ASR::Public, ASR::presenceType::Required, + false); + current_scope->add_symbol(return_var_name, ASR::down_cast(return_var)); + to_return = ASRUtils::EXPR(ASR::make_Var_t(al, x.base.base.loc, + ASR::down_cast(return_var))); + } + + tmp = ASR::make_Function_t( + al, x.base.base.loc, + /* a_symtab */ current_scope, + /* a_name */ s2c(al, sym_name), + /* a_args */ args.p, + /* n_args */ args.size(), + /* a_type_parameters */ nullptr, + /* n_type_parameters */ 0, + /* a_body */ nullptr, + /* n_body */ 0, + /* a_return_var */ to_return, + ASR::abiType::Source, ASR::accessType::Public, ASR::deftypeType::Interface, + nullptr, false, false, false, false); + parent_scope->add_symbol(sym_name, ASR::down_cast(tmp)); + current_scope = parent_scope; + } + void visit_FuncCallOrArray(const AST::FuncCallOrArray_t &x) { SymbolTable *scope = current_scope; std::string var_name = to_lower(x.m_func); @@ -2529,6 +2595,14 @@ class CommonVisitor : public AST::BaseVisitor { if( !is_function ) { return; } + if (compiler_options.implicit_interface && is_function && !v) { + // Function Call is not defined in this case. + // We need to create an interface and add the Function into + // the symbol table. + create_implicit_interface_function(x, var_name, true); + v = current_scope->resolve_symbol(var_name); + LFORTRAN_ASSERT(v!=nullptr); + } } ASR::symbol_t *f2 = ASRUtils::symbol_get_past_external(v); if (ASR::is_a(*f2)) { @@ -2647,9 +2721,14 @@ class CommonVisitor : public AST::BaseVisitor { ASR::symbol_t* resolve_intrinsic_function(const Location &loc, const std::string &remote_sym) { if (!intrinsic_procedures.is_intrinsic(remote_sym)) { - throw SemanticError("Function '" + remote_sym + "' not found" - " or not implemented yet (if it is intrinsic)", - loc); + if (compiler_options.implicit_interface) { + return nullptr; + } + else{ + throw SemanticError("Function '" + remote_sym + "' not found" + " or not implemented yet (if it is intrinsic)", + loc); + } } std::string module_name = intrinsic_procedures.get_module(remote_sym, loc); diff --git a/src/lfortran/semantics/ast_symboltable_visitor.cpp b/src/lfortran/semantics/ast_symboltable_visitor.cpp index 1aae50ad16..a7ef8bd895 100644 --- a/src/lfortran/semantics/ast_symboltable_visitor.cpp +++ b/src/lfortran/semantics/ast_symboltable_visitor.cpp @@ -347,7 +347,7 @@ class SymbolTableVisitor : public CommonVisitor { nullptr, current_procedure_abi_type, s_access, deftype, bindc_name, - is_pure, is_module, false); + is_pure, is_module, false, false); parent_scope->add_symbol(sym_name, ASR::down_cast(tmp)); current_scope = parent_scope; /* FIXME: This can become incorrect/get cleared prematurely, perhaps @@ -513,7 +513,7 @@ class SymbolTableVisitor : public CommonVisitor { } } } - if(type_param) type = LFortran::ASRUtils::TYPE(ASR::make_TypeParameter_t(al, x.base.base.loc, nullptr, nullptr, 0)); + if(type_param) type = LFortran::ASRUtils::TYPE(ASR::make_TypeParameter_t(al, x.base.base.loc, nullptr, nullptr, 0, nullptr, 0)); else type = LFortran::ASRUtils::TYPE(ASR::make_Derived_t(al, x.base.base.loc, v, nullptr, 0)); break; @@ -599,7 +599,7 @@ class SymbolTableVisitor : public CommonVisitor { /* n_body */ 0, /* a_return_var */ LFortran::ASRUtils::EXPR(return_var_ref), current_procedure_abi_type, s_access, deftype, - bindc_name, is_elemental, false, false); + bindc_name, is_elemental, false, false, false); parent_scope->add_symbol(sym_name, ASR::down_cast(tmp)); current_scope = parent_scope; current_procedure_args.clear(); @@ -657,7 +657,7 @@ class SymbolTableVisitor : public CommonVisitor { parent_sym = parent_scope->get_symbol(parent_sym_name); } if(is_template && data_member_names.size() == 0){ - current_template_type_parameters.push_back(ASR::make_TypeParameter_t(al, x.base.base.loc, s2c(al, to_lower(x.m_name)), nullptr, 0)); + current_template_type_parameters.push_back(ASR::make_TypeParameter_t(al, x.base.base.loc, s2c(al, to_lower(x.m_name)), nullptr, 0, nullptr, 0)); } tmp = ASR::make_DerivedType_t(al, x.base.base.loc, current_scope, s2c(al, to_lower(x.m_name)), data_member_names.p, data_member_names.size(), diff --git a/src/lfortran/semantics/comptime_eval.h b/src/lfortran/semantics/comptime_eval.h index 68ff25ce28..c860378ce8 100644 --- a/src/lfortran/semantics/comptime_eval.h +++ b/src/lfortran/semantics/comptime_eval.h @@ -85,7 +85,9 @@ struct IntrinsicProcedures { {"min", {m_math2, &eval_min, true}}, {"max", {m_math2, &eval_max, true}}, {"min0", {m_math2, &eval_min0, true}}, + {"dmin1", {m_math2, &eval_dmin1, true}}, {"max0", {m_math2, &eval_max0, true}}, + {"dmax1", {m_math2, &eval_dmax1, true}}, {"merge", {m_math2, ¬_implemented, false}}, {"selected_int_kind", {m_kind, &eval_selected_int_kind, true}}, {"selected_real_kind", {m_kind, &eval_selected_real_kind, true}}, @@ -107,6 +109,11 @@ struct IntrinsicProcedures { {"erfc", {m_math, &eval_erfc, true}}, {"abs", {m_math, &eval_abs, true}}, {"sqrt", {m_math, &eval_sqrt, true}}, + {"dsqrt", {m_math, &eval_dsqrt, true}}, + {"datan", {m_math, &eval_datan, true}}, + {"dabs", {m_math2, &eval_dabs, true}}, + {"dcos", {m_math, &eval_dcos, true}}, + {"dsin", {m_math, &eval_dsin, true}}, {"gamma", {m_math, &eval_gamma, true}}, {"log_gamma", {m_math, &eval_log_gamma, true}}, {"log10", {m_math, &eval_log10, true}}, @@ -525,6 +532,12 @@ TRIG2(log, slog) TRIG2(log, clog) TRIG2(log, zlog) +TRIG2(sin, dsin) +TRIG2(cos, dcos) +TRIG2(atan, datan) +TRIG2(sqrt, dsqrt) + + static ASR::expr_t *eval_erf(Allocator &al, const Location &loc, Vec &args) { return eval_trig(al, loc, args, &erf, nullptr); } @@ -613,6 +626,13 @@ TRIG2(log, zlog) true); } + static ASR::expr_t *eval_dmin1(Allocator &al, const Location &loc, Vec &args) { + return eval_2args_ri(al, loc, args, + &IntrinsicProcedures::lfortran_min, + &IntrinsicProcedures::lfortran_min_i, + true); + } + static ASR::expr_t *eval_min0(Allocator &al, const Location &loc, Vec &args) { return eval_2args_ri(al, loc, args, &IntrinsicProcedures::lfortran_min, @@ -635,6 +655,13 @@ TRIG2(log, zlog) true); } + static ASR::expr_t *eval_dmax1(Allocator &al, const Location &loc, Vec &args) { + return eval_2args_ri(al, loc, args, + &IntrinsicProcedures::lfortran_max, + &IntrinsicProcedures::lfortran_max_i, + true); + } + static ASR::expr_t *eval_max0(Allocator &al, const Location &loc, Vec &args) { return eval_2args_ri(al, loc, args, &IntrinsicProcedures::lfortran_max, @@ -670,6 +697,24 @@ TRIG2(log, zlog) } } + static ASR::expr_t *eval_dabs(Allocator &al, const Location &loc, + Vec &args + ) { + LFORTRAN_ASSERT(ASRUtils::all_args_evaluated(args)); + if (args.size() != 1) { + throw SemanticError("Intrinsic abs function accepts exactly 1 argument", loc); + } + ASR::expr_t* trig_arg = args[0]; + ASR::ttype_t* t = LFortran::ASRUtils::expr_type(args[0]); + if (LFortran::ASR::is_a(*t)) { + double rv = ASR::down_cast(trig_arg)->m_r; + double val = std::abs(rv); + return ASR::down_cast(ASR::make_RealConstant_t(al, loc, val, t)); + } else { + throw SemanticError("Argument of the dabs function must be Real", loc); + } + } + static ASR::expr_t *eval_range(Allocator &al, const Location &loc, Vec &args ) { diff --git a/src/lfortran/tests/test_llvm.cpp b/src/lfortran/tests/test_llvm.cpp index e53157cd85..b775e1ab48 100644 --- a/src/lfortran/tests/test_llvm.cpp +++ b/src/lfortran/tests/test_llvm.cpp @@ -368,7 +368,7 @@ end function)"; LFortran::SymbolTable::reset_global_counter(); LFortran::ASR::TranslationUnit_t* asr = TRY(LFortran::ast_to_asr(al, *tu, diagnostics, nullptr, false, compiler_options)); - CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [(= (Var 2 f) (IntegerConstant 5 (Integer 4 [])) ())] (Var 2 f) Source Public Implementation () .false. .false. .false.)}) [])"); + CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [(= (Var 2 f) (IntegerConstant 5 (Integer 4 [])) ())] (Var 2 f) Source Public Implementation () .false. .false. .false. .false.)}) [])"); // ASR -> LLVM LFortran::LLVMEvaluator e; @@ -406,7 +406,7 @@ end function)"; // AST -> ASR LFortran::ASR::TranslationUnit_t* asr = TRY(LFortran::ast_to_asr(al, *tu, diagnostics, nullptr, false, compiler_options)); - CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 3 {f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [(= (Var 4 f) (IntegerConstant 4 (Integer 4 [])) ())] (Var 4 f) Source Public Implementation () .false. .false. .false.)}) [])"); + CHECK(LFortran::pickle(*asr) == "(TranslationUnit (SymbolTable 3 {f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) f [] [] [(= (Var 4 f) (IntegerConstant 4 (Integer 4 [])) ())] (Var 4 f) Source Public Implementation () .false. .false. .false. .false.)}) [])"); // ASR -> LLVM LFortran::LLVMEvaluator e; LCompilers::PassManager lpm; diff --git a/src/libasr/ASR.asdl b/src/libasr/ASR.asdl index 643d012d4e..aeee4588bf 100644 --- a/src/libasr/ASR.asdl +++ b/src/libasr/ASR.asdl @@ -87,7 +87,7 @@ symbol | Function(symbol_table symtab, identifier name, expr* args, ttype* type_params, stmt* body, expr? return_var, abi abi, access access, deftype deftype, string? bindc_name, bool elemental, - bool pure, bool module) + bool pure, bool module, bool inline) | GenericProcedure(symbol_table parent_symtab, identifier name, symbol* procs, access access) | CustomOperator(symbol_table parent_symtab, identifier name, @@ -206,6 +206,7 @@ stmt | SetRemove(expr a, expr ele) | ListInsert(expr a, expr pos, expr ele) | ListRemove(expr a, expr ele) + | ListClear(expr a) | DictInsert(expr a, expr key, expr value) @@ -328,7 +329,11 @@ ttype | Dict(ttype key_type, ttype value_type) | Pointer(ttype type) | CPtr() - | TypeParameter(identifier param, dimension* dims) + | TypeParameter(identifier param, dimension* dims, restriction* rt) + +restriction = Restriction(trait rt) + +trait = SupportsZero | SupportsPlus | Divisible | Any binop = Add | Sub | Mul | Div | Pow | BitAnd | BitOr | BitXor | BitLShift | BitRShift @@ -345,6 +350,7 @@ cast_kind | IntegerToReal | LogicalToReal | RealToReal + | TemplateToReal | IntegerToInteger | RealToComplex | IntegerToComplex @@ -352,6 +358,7 @@ cast_kind | RealToLogical | CharacterToLogical | CharacterToInteger + | CharacterToList | ComplexToLogical | ComplexToComplex | ComplexToReal diff --git a/src/libasr/asdl_cpp.py b/src/libasr/asdl_cpp.py index 41fdb6f38b..f220d32359 100644 --- a/src/libasr/asdl_cpp.py +++ b/src/libasr/asdl_cpp.py @@ -2194,7 +2194,7 @@ def add_masks(fields, node): visitors = [ASTNodeVisitor0, ASTNodeVisitor1, ASTNodeVisitor, ASTVisitorVisitor1, ASTVisitorVisitor1b, ASTVisitorVisitor2, - ASTWalkVisitorVisitor, PickleVisitorVisitor, + ASTWalkVisitorVisitor, TreeVisitorVisitor, PickleVisitorVisitor, SerializationVisitorVisitor, DeserializationVisitorVisitor] diff --git a/src/libasr/asr_utils.cpp b/src/libasr/asr_utils.cpp index e6907ab710..b57f100ff9 100644 --- a/src/libasr/asr_utils.cpp +++ b/src/libasr/asr_utils.cpp @@ -659,6 +659,11 @@ bool types_equal(const ASR::ttype_t &a, const ASR::ttype_t &b) { } break; } + case (ASR::ttypeType::List) : { + ASR::List_t *a2 = ASR::down_cast(&a); + ASR::List_t *b2 = ASR::down_cast(&b); + return types_equal(*a2->m_type, *b2->m_type); + } case (ASR::ttypeType::Derived) : { ASR::Derived_t *a2 = ASR::down_cast(&a); ASR::Derived_t *b2 = ASR::down_cast(&b); diff --git a/src/libasr/asr_utils.h b/src/libasr/asr_utils.h index 12d353c537..ac81681dcf 100644 --- a/src/libasr/asr_utils.h +++ b/src/libasr/asr_utils.h @@ -142,6 +142,10 @@ static inline std::string type_to_str(const ASR::ttype_t *t) return type_to_str(ASRUtils::type_get_past_pointer( const_cast(t))) + " pointer"; } + case ASR::ttypeType::TypeParameter: { + ASR::TypeParameter_t* tp = ASR::down_cast(t); + return tp->m_param; + } default : throw LCompilersException("Not implemented " + std::to_string(t->type) + "."); } } @@ -983,16 +987,12 @@ static inline bool is_logical(ASR::ttype_t &x) { } static inline bool is_generic(ASR::ttype_t &x) { - return ASR::is_a(*type_get_past_pointer(&x)); -} - -static inline std::string get_parameter_name(const ASR::ttype_t* t) { - switch (t->type) { - case ASR::ttypeType::TypeParameter: { - ASR::TypeParameter_t* tp = ASR::down_cast(t); - return tp->m_param; + switch (x.type) { + case ASR::ttypeType::List: { + ASR::List_t *list_type = ASR::down_cast(type_get_past_pointer(&x)); + return is_generic(*list_type->m_type); } - default: throw LCompilersException("Cannot obtain type parameter from this type"); + default : return ASR::is_a(*type_get_past_pointer(&x)); } } @@ -1072,6 +1072,16 @@ inline int extract_dimensions_from_ttype(ASR::ttype_t *x, m_dims = nullptr; break; } + case ASR::ttypeType::Tuple: { + n_dims = 0; + m_dims = nullptr; + break; + } + case ASR::ttypeType::Dict: { + n_dims = 0; + m_dims = nullptr; + break; + } case ASR::ttypeType::CPtr: { n_dims = 0; m_dims = nullptr; @@ -1214,7 +1224,34 @@ static inline ASR::ttype_t* duplicate_type(Allocator& al, const ASR::ttype_t* t, ASR::dimension_t* dimsp = dims ? dims->p : tp->m_dims; size_t dimsn = dims ? dims->n : tp->n_dims; return ASRUtils::TYPE(ASR::make_TypeParameter_t(al, t->base.loc, - tp->m_param, dimsp, dimsn)); + tp->m_param, dimsp, dimsn, tp->m_rt, tp->n_rt)); + } + default : throw LCompilersException("Not implemented " + std::to_string(t->type)); + } +} + +static inline ASR::ttype_t* duplicate_type_without_dims(Allocator& al, const ASR::ttype_t* t) { + switch (t->type) { + case ASR::ttypeType::Integer: { + ASR::Integer_t* tnew = ASR::down_cast(t); + return ASRUtils::TYPE(ASR::make_Integer_t(al, t->base.loc, + tnew->m_kind, nullptr, 0)); + } + case ASR::ttypeType::Real: { + ASR::Real_t* tnew = ASR::down_cast(t); + return ASRUtils::TYPE(ASR::make_Real_t(al, t->base.loc, + tnew->m_kind, nullptr, 0)); + } + case ASR::ttypeType::Character: { + ASR::Character_t* tnew = ASR::down_cast(t); + return ASRUtils::TYPE(ASR::make_Character_t(al, t->base.loc, + tnew->m_kind, tnew->m_len, tnew->m_len_expr, + nullptr, 0)); + } + case ASR::ttypeType::TypeParameter: { + ASR::TypeParameter_t* tp = ASR::down_cast(t); + return ASRUtils::TYPE(ASR::make_TypeParameter_t(al, t->base.loc, + tp->m_param, nullptr, 0, tp->m_rt, tp->n_rt)); } default : throw LCompilersException("Not implemented " + std::to_string(t->type)); } @@ -1434,6 +1471,30 @@ static inline ASR::ttype_t* get_contained_type(ASR::ttype_t* asr_type) { } } +static inline ASR::ttype_t* get_type_parameter(ASR::ttype_t* t) { + switch (t->type) { + case ASR::ttypeType::TypeParameter: { + return t; + } + case ASR::ttypeType::List: { + ASR::List_t *tl = ASR::down_cast(t); + return get_type_parameter(tl->m_type); + } + default: throw LCompilersException("Cannot get type parameter from this type."); + } +} + +static inline bool has_trait(ASR::TypeParameter_t *tp, ASR::traitType rt) { + for (size_t i=0; in_rt; i++) { + ASR::Restriction_t *restriction = ASR::down_cast(tp->m_rt[i]); + if (restriction->m_rt == rt) { + return true; + } + } + return false; +} + + class ReplaceArgVisitor: public ASR::BaseExprReplacer { private: diff --git a/src/libasr/codegen/asr_to_c.cpp b/src/libasr/codegen/asr_to_c.cpp index 66e14c0459..278ced37ef 100644 --- a/src/libasr/codegen/asr_to_c.cpp +++ b/src/libasr/codegen/asr_to_c.cpp @@ -655,6 +655,7 @@ Result asr_to_c(Allocator &al, ASR::TranslationUnit_t &asr, diag::Diagnostics &diagnostics, Platform &platform, int64_t default_lower_bound) { + LCompilers::PassOptions pass_options; pass_options.always_run = true; pass_unused_functions(al, asr, pass_options); diff --git a/src/libasr/codegen/asr_to_c_cpp.h b/src/libasr/codegen/asr_to_c_cpp.h index 5151018f12..5d55780dc8 100644 --- a/src/libasr/codegen/asr_to_c_cpp.h +++ b/src/libasr/codegen/asr_to_c_cpp.h @@ -225,11 +225,37 @@ R"(#include indentation_level -= 2; } + void visit_BlockCall(const ASR::BlockCall_t &x) { + LFORTRAN_ASSERT(ASR::is_a(*x.m_m)); + ASR::Block_t* block = ASR::down_cast(x.m_m); + std::string decl, body; + std::string indent(indentation_level*indentation_spaces, ' '); + std::string open_paranthesis = indent + "{\n"; + std::string close_paranthesis = indent + "}\n"; + indent += std::string(indentation_spaces, ' '); + indentation_level += 1; + for (auto &item : block->m_symtab->get_scope()) { + if (ASR::is_a(*item.second)) { + ASR::Variable_t *v = ASR::down_cast(item.second); + decl += indent + self().convert_variable_decl(*v) + ";\n"; + } + } + for (size_t i=0; in_body; i++) { + self().visit_stmt(*block->m_body[i]); + body += src; + } + src = open_paranthesis + decl + body + close_paranthesis; + indentation_level -= 1; + } + // Returns the declaration, no semi colon at the end std::string get_function_declaration(const ASR::Function_t &x) { template_for_Kokkos.clear(); template_number = 0; - std::string sub; + std::string sub, inl; + if (x.m_inline) { + inl = "inline __attribute__((always_inline)) "; + } if (x.m_return_var) { ASR::Variable_t *return_var = LFortran::ASRUtils::EXPR2VAR(x.m_return_var); if (ASRUtils::is_integer(*return_var->m_type)) { @@ -287,7 +313,7 @@ R"(#include if (sym_name == "exit") { sym_name = "_xx_lcompilers_changed_exit_xx"; } - std::string func = sub + sym_name + "("; + std::string func = inl + sub + sym_name + "("; for (size_t i=0; im_intent)); @@ -556,11 +582,17 @@ R"(#include self().visit_expr(*x.m_arg); switch (x.m_kind) { case (ASR::cast_kindType::IntegerToReal) : { - src = "(float)(" + src + ")"; + int dest_kind = ASRUtils::extract_kind_from_ttype_t(x.m_type); + switch (dest_kind) { + case 4: src = "(float)(" + src + ")"; break; + case 8: src = "(double)(" + src + ")"; break; + default: throw CodeGenError("Cast IntegerToReal: Unsupported Kind " + std::to_string(dest_kind)); + } break; } case (ASR::cast_kindType::RealToInteger) : { - src = "(int)(" + src + ")"; + int dest_kind = ASRUtils::extract_kind_from_ttype_t(x.m_type); + src = "(int" + std::to_string(dest_kind * 8) + "_t)(" + src + ")"; break; } case (ASR::cast_kindType::RealToReal) : { @@ -797,6 +829,11 @@ R"(#include case (ASR::binopType::Sub) : { last_expr_precedence = 6; break; } case (ASR::binopType::Mul) : { last_expr_precedence = 5; break; } case (ASR::binopType::Div) : { last_expr_precedence = 5; break; } + case (ASR::binopType::BitAnd) : { last_expr_precedence = 11; break; } + case (ASR::binopType::BitOr) : { last_expr_precedence = 13; break; } + case (ASR::binopType::BitXor) : { last_expr_precedence = 12; break; } + case (ASR::binopType::BitLShift) : { last_expr_precedence = 7; break; } + case (ASR::binopType::BitRShift) : { last_expr_precedence = 7; break; } case (ASR::binopType::Pow) : { src = "pow(" + left + ", " + right + ")"; if (is_c) { @@ -806,7 +843,7 @@ R"(#include } return; } - default: throw CodeGenError("BinOp: operator not implemented yet"); + default: throw CodeGenError("BinOp: " + std::to_string(x.m_op) + " operator not implemented yet"); } src = ""; if (left_precedence == 3) { diff --git a/src/libasr/codegen/asr_to_llvm.cpp b/src/libasr/codegen/asr_to_llvm.cpp index 097b92bfae..a07f823d1e 100644 --- a/src/libasr/codegen/asr_to_llvm.cpp +++ b/src/libasr/codegen/asr_to_llvm.cpp @@ -112,33 +112,6 @@ uint64_t static get_hash(ASR::asr_t *node) return (uint64_t)node; } -void printf(llvm::LLVMContext &context, llvm::Module &module, - llvm::IRBuilder<> &builder, const std::vector &args) -{ - llvm::Function *fn_printf = module.getFunction("_lfortran_printf"); - if (!fn_printf) { - llvm::FunctionType *function_type = llvm::FunctionType::get( - llvm::Type::getVoidTy(context), {llvm::Type::getInt8PtrTy(context)}, true); - fn_printf = llvm::Function::Create(function_type, - llvm::Function::ExternalLinkage, "_lfortran_printf", &module); - } - builder.CreateCall(fn_printf, args); -} - -void exit(llvm::LLVMContext &context, llvm::Module &module, - llvm::IRBuilder<> &builder, llvm::Value* exit_code) -{ - llvm::Function *fn_exit = module.getFunction("exit"); - if (!fn_exit) { - llvm::FunctionType *function_type = llvm::FunctionType::get( - llvm::Type::getVoidTy(context), {llvm::Type::getInt32Ty(context)}, - false); - fn_exit = llvm::Function::Create(function_type, - llvm::Function::ExternalLinkage, "exit", &module); - } - builder.CreateCall(fn_exit, {exit_code}); -} - void string_init(llvm::LLVMContext &context, llvm::Module &module, llvm::IRBuilder<> &builder, llvm::Value* arg_size, llvm::Value* arg_string) { std::string func_name = "_lfortran_string_init"; @@ -248,6 +221,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor std::unique_ptr llvm_utils; std::unique_ptr list_api; std::unique_ptr tuple_api; + std::unique_ptr dict_api; std::unique_ptr arr_descr; uint64_t ptr_loads; @@ -264,6 +238,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor llvm_utils(std::make_unique(context, builder.get())), list_api(std::make_unique(context, llvm_utils.get(), builder.get())), tuple_api(std::make_unique(context, llvm_utils.get(), builder.get())), + dict_api(std::make_unique(context, llvm_utils.get(), builder.get())), arr_descr(LLVMArrUtils::Descriptor::get_descriptor(context, builder.get(), llvm_utils.get(), @@ -271,6 +246,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor ptr_loads(2), is_assignment_target(false) { + llvm_utils->tuple_api = tuple_api.get(); + llvm_utils->list_api = list_api.get(); + llvm_utils->dict_api = dict_api.get(); } llvm::Value* CreateLoad(llvm::Value *x) { @@ -1035,7 +1013,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor // Generate function prototypes for (auto &item : x.m_global_scope->get_scope()) { if (is_a(*item.second)) { - visit_Function(*ASR::down_cast(item.second)); + if (ASR::down_cast(item.second)->n_type_params == 0) { + visit_Function(*ASR::down_cast(item.second)); + } } } prototype_only = false; @@ -1055,7 +1035,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor // Then do all the procedures for (auto &item : x.m_global_scope->get_scope()) { if (is_a(*item.second)) { - visit_symbol(*item.second); + if (ASR::down_cast(item.second)->n_type_params == 0) { + visit_symbol(*item.second); + } } } @@ -1156,10 +1138,19 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor void visit_ListConstant(const ASR::ListConstant_t& x) { ASR::List_t* list_type = ASR::down_cast(x.m_type); - llvm::Type* llvm_el_type = get_el_type(list_type->m_type); + bool is_array_type_local = false, is_malloc_array_type_local = false; + bool is_list_local = false; + ASR::dimension_t* m_dims_local = nullptr; + int n_dims_local = -1, a_kind_local = -1; + llvm::Type* llvm_el_type = get_type_from_ttype_t(list_type->m_type, + ASR::storage_typeType::Default, is_array_type_local, + is_malloc_array_type_local, is_list_local, m_dims_local, + n_dims_local, a_kind_local); std::string type_code = ASRUtils::get_type_code(list_type->m_type); int32_t type_size = -1; - if( ASR::is_a(*list_type->m_type) ) { + if( ASR::is_a(*list_type->m_type) || + LLVM::is_llvm_struct(list_type->m_type) || + ASR::is_a(*list_type->m_type) ) { llvm::DataLayout data_layout(module.get()); type_size = data_layout.getTypeAllocSize(llvm_el_type); } else { @@ -1174,12 +1165,36 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor this->visit_expr(*x.m_args[i]); llvm::Value* item = tmp; llvm::Value* pos = llvm::ConstantInt::get(context, llvm::APInt(32, i)); - list_api->write_item(const_list, pos, item); + list_api->write_item(const_list, pos, item, list_type->m_type, *module); } ptr_loads = ptr_loads_copy; tmp = const_list; } + void visit_DictConstant(const ASR::DictConstant_t& x) { + llvm::Type* const_dict_type = get_dict_type(x.m_type); + llvm::Value* const_dict = builder->CreateAlloca(const_dict_type, nullptr, "const_dict"); + ASR::Dict_t* x_dict = ASR::down_cast(x.m_type); + std::string key_type_code = ASRUtils::get_type_code(x_dict->m_key_type); + std::string value_type_code = ASRUtils::get_type_code(x_dict->m_value_type); + dict_api->dict_init(key_type_code, value_type_code, const_dict, module.get(), x.n_keys); + uint64_t ptr_loads_key = LLVM::is_llvm_struct(x_dict->m_key_type) ? 0 : 2; + uint64_t ptr_loads_value = LLVM::is_llvm_struct(x_dict->m_value_type) ? 0 : 2; + uint64_t ptr_loads_copy = ptr_loads; + for( size_t i = 0; i < x.n_keys; i++ ) { + ptr_loads = ptr_loads_key; + visit_expr(*x.m_keys[i]); + llvm::Value* key = tmp; + ptr_loads = ptr_loads_value; + visit_expr(*x.m_values[i]); + llvm::Value* value = tmp; + dict_api->write_item(const_dict, key, value, module.get(), + x_dict->m_key_type, x_dict->m_value_type); + } + ptr_loads = ptr_loads_copy; + tmp = const_dict; + } + void visit_TupleConstant(const ASR::TupleConstant_t& x) { ASR::Tuple_t* tuple_type = ASR::down_cast(x.m_type); std::string type_code = ASRUtils::get_type_code(tuple_type->m_type, @@ -1198,10 +1213,13 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor llvm::Type* const_tuple_type = tuple_api->get_tuple_type(type_code, llvm_el_types); llvm::Value* const_tuple = builder->CreateAlloca(const_tuple_type, nullptr, "const_tuple"); std::vector init_values; + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 2; for( size_t i = 0; i < x.n_elements; i++ ) { this->visit_expr(*x.m_elements[i]); init_values.push_back(tmp); } + ptr_loads = ptr_loads_copy; tuple_api->tuple_init(const_tuple, init_values); tmp = const_tuple; } @@ -1227,31 +1245,70 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } void visit_ListAppend(const ASR::ListAppend_t& x) { + ASR::List_t* asr_list = ASR::down_cast(ASRUtils::expr_type(x.m_a)); uint64_t ptr_loads_copy = ptr_loads; ptr_loads = 0; this->visit_expr(*x.m_a); - ptr_loads = ptr_loads_copy; llvm::Value* plist = tmp; + ptr_loads = !LLVM::is_llvm_struct(asr_list->m_type); this->visit_expr_wrapper(x.m_ele, true); llvm::Value *item = tmp; + ptr_loads = ptr_loads_copy; - ASR::List_t* asr_list = ASR::down_cast(ASRUtils::expr_type(x.m_a)); - std::string type_code = ASRUtils::get_type_code(asr_list->m_type); - list_api->append(plist, item, *module, type_code); + list_api->append(plist, item, asr_list->m_type, *module); } void visit_ListItem(const ASR::ListItem_t& x) { + ASR::ttype_t* el_type = ASRUtils::get_contained_type( + ASRUtils::expr_type(x.m_a)); uint64_t ptr_loads_copy = ptr_loads; ptr_loads = 0; this->visit_expr(*x.m_a); - ptr_loads = ptr_loads_copy; llvm::Value* plist = tmp; + ptr_loads = 1; this->visit_expr_wrapper(x.m_pos, true); + ptr_loads = ptr_loads_copy; llvm::Value *pos = tmp; - tmp = list_api->read_item(plist, pos); + tmp = list_api->read_item(plist, pos, + (LLVM::is_llvm_struct(el_type) || + ptr_loads == 0)); + } + + void visit_DictItem(const ASR::DictItem_t& x) { + ASR::Dict_t* dict_type = ASR::down_cast( + ASRUtils::expr_type(x.m_a)); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* pdict = tmp; + + ptr_loads = !LLVM::is_llvm_struct(dict_type->m_key_type); + this->visit_expr_wrapper(x.m_key, true); + ptr_loads = ptr_loads_copy; + llvm::Value *key = tmp; + + tmp = dict_api->read_item(pdict, key, *module, dict_type->m_key_type, + LLVM::is_llvm_struct(dict_type->m_value_type)); + } + + void visit_DictPop(const ASR::DictPop_t& x) { + ASR::Dict_t* dict_type = ASR::down_cast( + ASRUtils::expr_type(x.m_a)); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* pdict = tmp; + + ptr_loads = !LLVM::is_llvm_struct(dict_type->m_key_type); + this->visit_expr_wrapper(x.m_key, true); + ptr_loads = ptr_loads_copy; + llvm::Value *key = tmp; + + tmp = dict_api->pop_item(pdict, key, *module, dict_type, + LLVM::is_llvm_struct(dict_type->m_value_type)); } void visit_ListLen(const ASR::ListLen_t& x) { @@ -1267,6 +1324,85 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } } + void visit_DictLen(const ASR::DictLen_t& x) { + if (x.m_value) { + this->visit_expr(*x.m_value); + return ; + } + + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_arg); + ptr_loads = ptr_loads_copy; + llvm::Value* pdict = tmp; + tmp = dict_api->len(pdict); + } + + void visit_ListInsert(const ASR::ListInsert_t& x) { + ASR::List_t* asr_list = ASR::down_cast( + ASRUtils::expr_type(x.m_a)); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* plist = tmp; + + ptr_loads = 1; + this->visit_expr_wrapper(x.m_pos, true); + llvm::Value *pos = tmp; + + ptr_loads = !LLVM::is_llvm_struct(asr_list->m_type); + this->visit_expr_wrapper(x.m_ele, true); + llvm::Value *item = tmp; + ptr_loads = ptr_loads_copy; + + list_api->insert_item(plist, pos, item, asr_list->m_type, *module); + } + + void visit_DictInsert(const ASR::DictInsert_t& x) { + ASR::Dict_t* dict_type = ASR::down_cast( + ASRUtils::expr_type(x.m_a)); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* pdict = tmp; + + ptr_loads = !LLVM::is_llvm_struct(dict_type->m_key_type); + this->visit_expr_wrapper(x.m_key, true); + llvm::Value *key = tmp; + ptr_loads = !LLVM::is_llvm_struct(dict_type->m_value_type); + this->visit_expr_wrapper(x.m_value, true); + llvm::Value *value = tmp; + ptr_loads = ptr_loads_copy; + + dict_api->write_item(pdict, key, value, module.get(), + dict_type->m_key_type, + dict_type->m_value_type); + } + + void visit_ListRemove(const ASR::ListRemove_t& x) { + ASR::ttype_t* asr_el_type = ASRUtils::get_contained_type(ASRUtils::expr_type(x.m_a)); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* plist = tmp; + + ptr_loads = !LLVM::is_llvm_struct(asr_el_type); + this->visit_expr_wrapper(x.m_ele, true); + ptr_loads = ptr_loads_copy; + llvm::Value *item = tmp; + list_api->remove(plist, item, asr_el_type, *module); + } + + void visit_ListClear(const ASR::ListClear_t& x) { + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_a); + llvm::Value* plist = tmp; + ptr_loads = ptr_loads_copy; + + list_api->list_clear(plist); + } + void visit_TupleLen(const ASR::TupleLen_t& x) { LFORTRAN_ASSERT(x.m_value); this->visit_expr(*x.m_value); @@ -1282,7 +1418,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor this->visit_expr_wrapper(x.m_pos, true); llvm::Value *pos = tmp; - tmp = tuple_api->read_item(ptuple, pos); + tmp = tuple_api->read_item(ptuple, pos, LLVM::is_llvm_struct(x.m_type)); } void visit_ArrayItem(const ASR::ArrayItem_t& x) { @@ -1302,9 +1438,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor LFORTRAN_ASSERT(llvm_symtab.find(v_h) != llvm_symtab.end()); array = llvm_symtab[v_h]; is_argument = (v->m_intent == ASRUtils::intent_in) - || (v->m_intent == ASRUtils::intent_out) - || (v->m_intent == ASRUtils::intent_inout) - || (v->m_intent == ASRUtils::intent_unspecified); + || (v->m_intent == ASRUtils::intent_out) + || (v->m_intent == ASRUtils::intent_inout) + || (v->m_intent == ASRUtils::intent_unspecified); } else { int64_t ptr_loads_copy = ptr_loads; ptr_loads = 0; @@ -1647,6 +1783,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } void visit_Program(const ASR::Program_t &x) { + bool is_dict_present_copy = dict_api->is_dict_present; + dict_api->is_dict_present = false; llvm_goto_targets.clear(); // Generate code for nested subroutines and functions first: for (auto &item : x.m_symtab->get_scope()) { @@ -1675,6 +1813,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor llvm::Value *ret_val2 = llvm::ConstantInt::get(context, llvm::APInt(32, 0)); builder->CreateRet(ret_val2); + dict_api->is_dict_present = is_dict_present_copy; } /* @@ -1695,6 +1834,41 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor return false; } + int32_t get_type_size(ASR::ttype_t* asr_type, llvm::Type* llvm_type, + int32_t a_kind) { + if( LLVM::is_llvm_struct(asr_type) || + ASR::is_a(*asr_type) || + ASR::is_a(*asr_type) ) { + llvm::DataLayout data_layout(module.get()); + return data_layout.getTypeAllocSize(llvm_type); + } + return a_kind; + } + + llvm::Type* get_dict_type(ASR::ttype_t* asr_type) { + ASR::Dict_t* asr_dict = ASR::down_cast(asr_type); + bool is_local_array_type = false, is_local_malloc_array_type = false; + bool is_local_list = false; + ASR::dimension_t* local_m_dims = nullptr; + int local_n_dims = 0; + int local_a_kind = -1; + ASR::storage_typeType local_m_storage = ASR::storage_typeType::Default; + llvm::Type* key_llvm_type = get_type_from_ttype_t(asr_dict->m_key_type, local_m_storage, + is_local_array_type, is_local_malloc_array_type, + is_local_list, local_m_dims, local_n_dims, + local_a_kind); + int32_t key_type_size = get_type_size(asr_dict->m_key_type, key_llvm_type, local_a_kind); + llvm::Type* value_llvm_type = get_type_from_ttype_t(asr_dict->m_value_type, local_m_storage, + is_local_array_type, is_local_malloc_array_type, + is_local_list, local_m_dims, local_n_dims, + local_a_kind); + int32_t value_type_size = get_type_size(asr_dict->m_value_type, value_llvm_type, local_a_kind); + std::string key_type_code = ASRUtils::get_type_code(asr_dict->m_key_type); + std::string value_type_code = ASRUtils::get_type_code(asr_dict->m_value_type); + return dict_api->get_dict_type(key_type_code, value_type_code, key_type_size, + value_type_size, key_llvm_type, value_llvm_type); + } + llvm::Type* get_type_from_ttype_t(ASR::ttype_t* asr_type, ASR::storage_typeType m_storage, bool& is_array_type, bool& is_malloc_array_type, @@ -1832,7 +2006,9 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor a_kind); std::string el_type_code = ASRUtils::get_type_code(asr_list->m_type); int32_t type_size = -1; - if( ASR::is_a(*asr_list->m_type) ) { + if( LLVM::is_llvm_struct(asr_list->m_type) || + ASR::is_a(*asr_list->m_type) || + ASR::is_a(*asr_list->m_type) ) { llvm::DataLayout data_layout(module.get()); type_size = data_layout.getTypeAllocSize(el_llvm_type); } else { @@ -1841,6 +2017,10 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor llvm_type = list_api->get_list_type(el_llvm_type, el_type_code, type_size); break; } + case (ASR::ttypeType::Dict): { + llvm_type = get_dict_type(asr_type); + break; + } case (ASR::ttypeType::Tuple) : { ASR::Tuple_t* asr_tuple = ASR::down_cast(asr_type); std::string type_code = ASRUtils::get_type_code(asr_tuple->m_type, @@ -1871,6 +2051,17 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor return llvm_type; } + inline llvm::Type* get_type_from_ttype_t_util(ASR::ttype_t* asr_type) { + ASR::storage_typeType m_storage_local = ASR::storage_typeType::Default; + bool is_array_type_local, is_malloc_array_type_local; + bool is_list_local; + ASR::dimension_t* m_dims_local; + int n_dims_local, a_kind_local; + return get_type_from_ttype_t(asr_type, m_storage_local, is_array_type_local, + is_malloc_array_type_local, is_list_local, + m_dims_local, n_dims_local, a_kind_local); + } + template void declare_vars(const T &x) { llvm::Value *target_var; @@ -2185,6 +2376,46 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor type = llvm::Type::getVoidTy(context)->getPointerTo(); break; } + case (ASR::ttypeType::Tuple) : { + ASR::Tuple_t* asr_tuple = ASR::down_cast(asr_type); + std::string type_code = ASRUtils::get_type_code(asr_tuple->m_type, + asr_tuple->n_type); + std::vector llvm_el_types; + for( size_t i = 0; i < asr_tuple->n_type; i++ ) { + bool is_local_array_type = false; + int local_n_dims = 0; + int local_a_kind = -1; + ASR::storage_typeType local_m_storage = ASR::storage_typeType::Default; + llvm_el_types.push_back(get_arg_type_from_ttype_t(asr_tuple->m_type[i], m_abi, + arg_m_abi, local_m_storage, arg_m_value_attr, local_n_dims, + local_a_kind, is_local_array_type, ASRUtils::intent_local)); + } + type = tuple_api->get_tuple_type(type_code, llvm_el_types)->getPointerTo(); + break; + } + case (ASR::ttypeType::List) : { + bool is_array_type = false, is_malloc_array_type = false; + bool is_list = true; + ASR::dimension_t *m_dims = nullptr; + ASR::List_t* asr_list = ASR::down_cast(asr_type); + llvm::Type* el_llvm_type = get_type_from_ttype_t(asr_list->m_type, m_storage, + is_array_type, + is_malloc_array_type, + is_list, m_dims, n_dims, + a_kind); + int32_t type_size = -1; + if( LLVM::is_llvm_struct(asr_list->m_type) || + ASR::is_a(*asr_list->m_type) || + ASR::is_a(*asr_list->m_type) ) { + llvm::DataLayout data_layout(module.get()); + type_size = data_layout.getTypeAllocSize(el_llvm_type); + } else { + type_size = a_kind; + } + std::string el_type_code = ASRUtils::get_type_code(asr_list->m_type); + type = list_api->get_list_type(el_llvm_type, el_type_code, type_size)->getPointerTo(); + break; + } default : LFORTRAN_ASSERT(false); } @@ -2396,6 +2627,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } void visit_Function(const ASR::Function_t &x) { + bool is_dict_present_copy = dict_api->is_dict_present; + dict_api->is_dict_present = false; llvm_goto_targets.clear(); instantiate_function(x); if (x.m_deftype == ASR::deftypeType::Interface) { @@ -2406,6 +2639,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor visit_procedures(x); generate_function(x); parent_function = nullptr; + dict_api->is_dict_present = is_dict_present_copy; } void instantiate_function(const ASR::Function_t &x){ @@ -2520,6 +2754,50 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor case (ASR::ttypeType::Derived) : throw CodeGenError("Derived return type not implemented yet"); break; + case (ASR::ttypeType::Tuple) : { + ASR::Tuple_t* asr_tuple = ASR::down_cast(return_var_type0); + std::string type_code = ASRUtils::get_type_code(asr_tuple->m_type, + asr_tuple->n_type); + std::vector llvm_el_types; + for( size_t i = 0; i < asr_tuple->n_type; i++ ) { + bool is_local_array_type = false, is_local_malloc_array_type = false; + bool is_local_list = false; + ASR::dimension_t* local_m_dims = nullptr; + int local_n_dims = 0; + int local_a_kind = -1; + ASR::storage_typeType local_m_storage = ASR::storage_typeType::Default; + llvm_el_types.push_back(get_type_from_ttype_t(asr_tuple->m_type[i], local_m_storage, + is_local_array_type, is_local_malloc_array_type, + is_local_list, local_m_dims, local_n_dims, local_a_kind)); + } + return_type = tuple_api->get_tuple_type(type_code, llvm_el_types); + break; + } + case (ASR::ttypeType::List) : { + bool is_array_type = false, is_malloc_array_type = false; + bool is_list = true; + ASR::dimension_t *m_dims = nullptr; + ASR::storage_typeType m_storage = ASR::storage_typeType::Default; + int n_dims = 0, a_kind = -1; + ASR::List_t* asr_list = ASR::down_cast(return_var_type0); + llvm::Type* el_llvm_type = get_type_from_ttype_t(asr_list->m_type, m_storage, + is_array_type, + is_malloc_array_type, + is_list, m_dims, n_dims, + a_kind); + int32_t type_size = -1; + if( LLVM::is_llvm_struct(asr_list->m_type) || + ASR::is_a(*asr_list->m_type) || + ASR::is_a(*asr_list->m_type) ) { + llvm::DataLayout data_layout(module.get()); + type_size = data_layout.getTypeAllocSize(el_llvm_type); + } else { + type_size = a_kind; + } + std::string el_type_code = ASRUtils::get_type_code(asr_list->m_type); + return_type = list_api->get_list_type(el_llvm_type, el_type_code, type_size); + break; + } default : LFORTRAN_ASSERT(false); throw CodeGenError("Type not implemented"); @@ -2876,6 +3154,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor bool is_value_list = ASR::is_a(*asr_value_type); bool is_target_tuple = ASR::is_a(*asr_target_type); bool is_value_tuple = ASR::is_a(*asr_value_type); + bool is_target_dict = ASR::is_a(*asr_target_type); + bool is_value_dict = ASR::is_a(*asr_value_type); if( is_target_list && is_value_list ) { uint64_t ptr_loads_copy = ptr_loads; ptr_loads = 0; @@ -2887,44 +3167,75 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor ASR::List_t* value_asr_list = ASR::down_cast( ASRUtils::expr_type(x.m_value)); std::string value_type_code = ASRUtils::get_type_code(value_asr_list->m_type); - list_api->list_deepcopy(value_list, target_list, value_type_code, *module); + list_api->list_deepcopy(value_list, target_list, + value_asr_list, *module); return ; } else if( is_target_tuple && is_value_tuple ) { uint64_t ptr_loads_copy = ptr_loads; - ptr_loads = 0; - this->visit_expr(*x.m_value); - llvm::Value* value_tuple = tmp; - if( ASR::is_a(*x.m_target) ) { - ptr_loads = ptr_loads_copy; + if( ASR::is_a(*x.m_target) && + !ASR::is_a(*x.m_value) ) { + ptr_loads = 0; + this->visit_expr(*x.m_value); + llvm::Value* value_tuple = tmp; ASR::TupleConstant_t* const_tuple = ASR::down_cast(x.m_target); for( size_t i = 0; i < const_tuple->n_elements; i++ ) { - // TODO: Adjust for global variables as well - // See if-else check on llvm_symtab for the logic - ASR::Variable_t *target_var = EXPR2VAR(const_tuple->m_elements[i]); - uint32_t h = get_hash((ASR::asr_t*)target_var); - llvm::Value* target_ptr = nullptr; - if (llvm_symtab.find(h) != llvm_symtab.end()) { - target_ptr = llvm_symtab[h]; - if (ASR::is_a(*target_var->m_type)) { - target_ptr = CreateLoad(target_ptr); - } - } else { - throw CodeGenError("Support for unpacking tuple value to " - "a global variable is not available yet."); - } + ptr_loads = 0; + visit_expr(*const_tuple->m_elements[i]); + llvm::Value* target_ptr = tmp; llvm::Value* item = tuple_api->read_item(value_tuple, i, false); builder->CreateStore(item, target_ptr); } + ptr_loads = ptr_loads_copy; + } else if( ASR::is_a(*x.m_target) && + ASR::is_a(*x.m_value) ) { + ASR::TupleConstant_t* asr_value_tuple = ASR::down_cast(x.m_value); + Vec src_deepcopies; + src_deepcopies.reserve(al, asr_value_tuple->n_elements); + for( size_t i = 0; i < asr_value_tuple->n_elements; i++ ) { + ASR::ttype_t* asr_tuple_i_type = ASRUtils::expr_type(asr_value_tuple->m_elements[i]); + llvm::Type* llvm_tuple_i_type = get_type_from_ttype_t_util(asr_tuple_i_type); + llvm::Value* llvm_tuple_i = builder->CreateAlloca(llvm_tuple_i_type, nullptr); + ptr_loads = !LLVM::is_llvm_struct(asr_tuple_i_type); + visit_expr(*asr_value_tuple->m_elements[i]); + llvm_utils->deepcopy(tmp, llvm_tuple_i, asr_tuple_i_type, *module); + src_deepcopies.push_back(al, llvm_tuple_i); + } + ASR::TupleConstant_t* asr_target_tuple = ASR::down_cast(x.m_target); + for( size_t i = 0; i < asr_target_tuple->n_elements; i++ ) { + ptr_loads = 0; + visit_expr(*asr_target_tuple->m_elements[i]); + LLVM::CreateStore(*builder, + LLVM::CreateLoad(*builder, src_deepcopies[i]), + tmp + ); + } + ptr_loads = ptr_loads_copy; } else { + ptr_loads = 0; + this->visit_expr(*x.m_value); + llvm::Value* value_tuple = tmp; this->visit_expr(*x.m_target); llvm::Value* target_tuple = tmp; ptr_loads = ptr_loads_copy; ASR::Tuple_t* value_tuple_type = ASR::down_cast(asr_value_type); std::string type_code = ASRUtils::get_type_code(value_tuple_type->m_type, value_tuple_type->n_type); - tuple_api->tuple_deepcopy(value_tuple, target_tuple, type_code); + tuple_api->tuple_deepcopy(value_tuple, target_tuple, + value_tuple_type, *module); } return ; + } else if( is_target_dict && is_value_dict ) { + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = 0; + this->visit_expr(*x.m_value); + llvm::Value* value_dict = tmp; + this->visit_expr(*x.m_target); + llvm::Value* target_dict = tmp; + ptr_loads = ptr_loads_copy; + ASR::Dict_t* value_dict_type = ASR::down_cast(asr_value_type); + dict_api->dict_deepcopy(value_dict, target_dict, + value_dict_type, module.get()); + return ; } if( ASR::is_a(*ASRUtils::expr_type(x.m_target)) && ASR::is_a(*x.m_value) ) { @@ -3327,6 +3638,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } void visit_WhileLoop(const ASR::WhileLoop_t &x) { + dict_api->set_iterators(); llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); @@ -3348,6 +3660,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor // end start_new_block(loopend); + dict_api->reset_iterators(); } void visit_Exit(const ASR::Exit_t & /* x */) { @@ -4868,10 +5181,13 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor } } } else { + ASR::ttype_t* arg_type = expr_type(x.m_args[i].m_value); + uint64_t ptr_loads_copy = ptr_loads; + ptr_loads = !LLVM::is_llvm_struct(arg_type); this->visit_expr_wrapper(x.m_args[i].m_value); llvm::Value *value=tmp; + ptr_loads = ptr_loads_copy; llvm::Type *target_type; - ASR::ttype_t* arg_type = expr_type(x.m_args[i].m_value); bool character_bindc = false; switch (arg_type->type) { case (ASR::ttypeType::Integer) : { @@ -4912,6 +5228,10 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor case (ASR::ttypeType::CPtr) : target_type = llvm::Type::getVoidTy(context)->getPointerTo(); break; + case (ASR::ttypeType::List) : { + target_type = get_type_from_ttype_t_util(arg_type); + break ; + } default : throw CodeGenError("Type " + ASRUtils::type_to_str(arg_type) + " not implemented yet."); } @@ -4947,7 +5267,12 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor if( ASR::is_a(*x.m_args[i].m_value) ) { value = CreateLoad(value); } - builder->CreateStore(value, target); + if( ASR::is_a(*arg_type) || + ASR::is_a(*arg_type) ) { + llvm_utils->deepcopy(value, target, arg_type, *module); + } else { + builder->CreateStore(value, target); + } tmp = target; } } @@ -5113,6 +5438,33 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor tmp = builder->CreateOr(arg1, arg2); } + llvm::Value* CreatePointerToStructReturnValue(llvm::FunctionType* fnty, + llvm::Value* return_value, + ASR::ttype_t* asr_return_type) { + if( !LLVM::is_llvm_struct(asr_return_type) ) { + return return_value; + } + + // Call to LLVM APIs not needed to fetch the return type of the function. + // We can use asr_return_type as well but anyways for compactness I did it here. + llvm::Value* pointer_to_struct = builder->CreateAlloca(fnty->getReturnType(), nullptr); + LLVM::CreateStore(*builder, return_value, pointer_to_struct); + return pointer_to_struct; + } + + llvm::Value* CreateCallUtil(llvm::FunctionType* fnty, llvm::Function* fn, + std::vector& args, + ASR::ttype_t* asr_return_type) { + llvm::Value* return_value = builder->CreateCall(fn, args); + return CreatePointerToStructReturnValue(fnty, return_value, + asr_return_type); + } + + llvm::Value* CreateCallUtil(llvm::Function* fn, std::vector& args, + ASR::ttype_t* asr_return_type) { + return CreateCallUtil(fn->getFunctionType(), fn, args, asr_return_type); + } + void visit_FunctionCall(const ASR::FunctionCall_t &x) { if( ASRUtils::is_intrinsic_optimization(x.m_name) ) { ASR::Function_t* routine = ASR::down_cast( @@ -5206,8 +5558,8 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor std::string m_name = std::string(((ASR::Function_t*)(&(x.m_name->base)))->m_name); std::vector args2 = convert_call_args(x, m_name); args.insert(args.end(), args2.begin(), args2.end()); + ASR::ttype_t *return_var_type0 = EXPR2VAR(s->m_return_var)->m_type; if (s->m_abi == ASR::abiType::BindC) { - ASR::ttype_t *return_var_type0 = EXPR2VAR(s->m_return_var)->m_type; if (is_a(*return_var_type0)) { int a_kind = down_cast(return_var_type0)->m_kind; if (a_kind == 8) { @@ -5227,7 +5579,7 @@ class ASRToLLVMVisitor : public ASR::BaseVisitor tmp = builder->CreateCall(fn, args); } } else { - tmp = builder->CreateCall(fn, args); + tmp = CreateCallUtil(fn, args, return_var_type0); } } if (s->m_abi == ASR::abiType::BindC) { diff --git a/src/libasr/codegen/asr_to_wasm.cpp b/src/libasr/codegen/asr_to_wasm.cpp index 950f8f7343..19af21f956 100644 --- a/src/libasr/codegen/asr_to_wasm.cpp +++ b/src/libasr/codegen/asr_to_wasm.cpp @@ -177,7 +177,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor { m_al, global_scope_loc, global_scope, s2c(m_al, import_func.name), params.data(), params.size(), nullptr, 0, nullptr, 0, nullptr, ASR::abiType::Source, ASR::accessType::Public, - ASR::deftypeType::Implementation, nullptr, false, false, false); + ASR::deftypeType::Implementation, nullptr, false, false, false, false); m_import_func_asr_map[import_func.name] = func; wasm::emit_import_fn(m_import_section, m_al, "js", import_func.name, @@ -261,6 +261,9 @@ class ASRToWASMVisitor : public ASR::BaseVisitor { } } + // Process procedures first: + declare_all_functions(*x.m_global_scope); + // then the main program: for (auto &item : x.m_global_scope->get_scope()) { if (ASR::is_a(*item.second)) { @@ -287,14 +290,8 @@ class ASRToWASMVisitor : public ASR::BaseVisitor { } } - // // Process procedures first: - // for (auto &item : x.m_global_scope->get_scope()) { - // if (ASR::is_a(*item.second) - // || ASR::is_a(*item.second)) { - // visit_symbol(*item.second); - // // std::cout << "I am here -1: " << src << std::endl; - // } - // } + // Process procedures first: + declare_all_functions(*x.m_global_scope); // // Then do all the modules in the right order // std::vector build_order @@ -348,7 +345,7 @@ class ASRToWASMVisitor : public ASR::BaseVisitor { m_al, x.base.base.loc, x.m_symtab, s2c(m_al, "_lcompilers_main"), nullptr, 0, nullptr, 0, x.m_body, x.n_body, nullptr, ASR::abiType::Source, ASR::accessType::Public, - ASR::deftypeType::Implementation, nullptr, false, false, false); + ASR::deftypeType::Implementation, nullptr, false, false, false, false); emit_function_prototype(*((ASR::Function_t *)main_func)); emit_function_body(*((ASR::Function_t *)main_func)); } diff --git a/src/libasr/codegen/llvm_utils.cpp b/src/libasr/codegen/llvm_utils.cpp index 64d76be72d..fe3593ad16 100644 --- a/src/libasr/codegen/llvm_utils.cpp +++ b/src/libasr/codegen/llvm_utils.cpp @@ -1,5 +1,6 @@ #include #include +#include namespace LFortran { @@ -48,6 +49,23 @@ namespace LFortran { return builder.CreateCall(fn, args); } + llvm::Value* lfortran_calloc(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, llvm::Value* count, llvm::Value* type_size) { + std::string func_name = "_lfortran_calloc"; + llvm::Function *fn = module.getFunction(func_name); + if (!fn) { + llvm::FunctionType *function_type = llvm::FunctionType::get( + llvm::Type::getInt8PtrTy(context), { + llvm::Type::getInt32Ty(context), + llvm::Type::getInt32Ty(context) + }, true); + fn = llvm::Function::Create(function_type, + llvm::Function::ExternalLinkage, func_name, module); + } + std::vector args = {count, type_size}; + return builder.CreateCall(fn, args); + } + llvm::Value* lfortran_realloc(llvm::LLVMContext &context, llvm::Module &module, llvm::IRBuilder<> &builder, llvm::Value* ptr, llvm::Value* arg_size) { std::string func_name = "_lfortran_realloc"; @@ -67,12 +85,32 @@ namespace LFortran { }; return builder.CreateCall(fn, args); } + + llvm::Value* lfortran_free(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, llvm::Value* ptr) { + std::string func_name = "_lfortran_free"; + llvm::Function *fn = module.getFunction(func_name); + if (!fn) { + llvm::FunctionType *function_type = llvm::FunctionType::get( + llvm::Type::getVoidTy(context), { + llvm::Type::getInt8PtrTy(context) + }, true); + fn = llvm::Function::Create(function_type, + llvm::Function::ExternalLinkage, func_name, module); + } + std::vector args = { + builder.CreateBitCast(ptr, llvm::Type::getInt8PtrTy(context)), + }; + return builder.CreateCall(fn, args); + } } // namespace LLVM LLVMUtils::LLVMUtils(llvm::LLVMContext& context, llvm::IRBuilder<>* _builder): context(context), - builder(std::move(_builder)) { + builder(std::move(_builder)), + str_cmp_itr(nullptr), + are_iterators_set(false) { } llvm::Value* LLVMUtils::create_gep(llvm::Value* ds, int idx) { @@ -155,6 +193,138 @@ namespace LFortran { builder->SetInsertPoint(bb); } + void LLVMUtils::set_iterators() { + if( are_iterators_set ) { + return ; + } + str_cmp_itr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr, "str_cmp_itr"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), str_cmp_itr); + are_iterators_set = true; + } + + void LLVMUtils::reset_iterators() { + str_cmp_itr = nullptr; + are_iterators_set = false; + } + + llvm::Value* LLVMUtils::lfortran_str_cmp(llvm::Value* left_arg, llvm::Value* right_arg, + std::string runtime_func_name, llvm::Module& module) + { + llvm::Type* character_type = llvm::Type::getInt8PtrTy(context); + llvm::Function *fn = module.getFunction(runtime_func_name); + if(!fn) { + llvm::FunctionType *function_type = llvm::FunctionType::get( + llvm::Type::getInt1Ty(context), { + character_type->getPointerTo(), + character_type->getPointerTo() + }, false); + fn = llvm::Function::Create(function_type, + llvm::Function::ExternalLinkage, runtime_func_name, module); + } + llvm::AllocaInst *pleft_arg = builder->CreateAlloca(character_type, nullptr); + LLVM::CreateStore(*builder, left_arg, pleft_arg); + llvm::AllocaInst *pright_arg = builder->CreateAlloca(character_type, nullptr); + LLVM::CreateStore(*builder, right_arg, pright_arg); + std::vector args = {pleft_arg, pright_arg}; + return builder->CreateCall(fn, args); + } + + llvm::Value* LLVMUtils::is_equal_by_value(llvm::Value* left, llvm::Value* right, + llvm::Module& module, ASR::ttype_t* asr_type) { + switch( asr_type->type ) { + case ASR::ttypeType::Integer: { + return builder->CreateICmpEQ(left, right); + }; + case ASR::ttypeType::Real: { + return builder->CreateFCmpOEQ(left, right); + } + case ASR::ttypeType::Character: { + if( !are_iterators_set ) { + str_cmp_itr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr); + } + llvm::Value* null_char = llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), + llvm::APInt(8, '\0')); + llvm::Value* idx = str_cmp_itr; + LLVM::CreateStore(*builder, + llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), llvm::APInt(32, 0)), + idx); + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + start_new_block(loophead); + { + llvm::Value* i = LLVM::CreateLoad(*builder, idx); + llvm::Value* l = LLVM::CreateLoad(*builder, create_ptr_gep(left, i)); + llvm::Value* r = LLVM::CreateLoad(*builder, create_ptr_gep(right, i)); + llvm::Value *cond = builder->CreateAnd( + builder->CreateICmpNE(l, null_char), + builder->CreateICmpNE(r, null_char) + ); + cond = builder->CreateAnd(cond, builder->CreateICmpEQ(l, r)); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + start_new_block(loopbody); + { + llvm::Value* i = LLVM::CreateLoad(*builder, idx); + i = builder->CreateAdd(i, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, i, idx); + } + + builder->CreateBr(loophead); + + // end + start_new_block(loopend); + llvm::Value* i = LLVM::CreateLoad(*builder, idx); + llvm::Value* l = LLVM::CreateLoad(*builder, create_ptr_gep(left, i)); + llvm::Value* r = LLVM::CreateLoad(*builder, create_ptr_gep(right, i)); + return builder->CreateICmpEQ(l, r); + } + case ASR::ttypeType::Tuple: { + ASR::Tuple_t* tuple_type = ASR::down_cast(asr_type); + return tuple_api->check_tuple_equality(left, right, tuple_type, context, + builder, module); + } + default: { + throw LCompilersException("LLVMUtils::is_equal_by_value isn't implemented for " + + ASRUtils::type_to_str_python(asr_type)); + } + } + } + + void LLVMUtils::deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::ttype_t* asr_type, llvm::Module& module) { + switch( asr_type->type ) { + case ASR::ttypeType::Integer: + case ASR::ttypeType::Real: + case ASR::ttypeType::Character: + case ASR::ttypeType::Logical: + case ASR::ttypeType::Complex: { + LLVM::CreateStore(*builder, src, dest); + break ; + }; + case ASR::ttypeType::Tuple: { + ASR::Tuple_t* tuple_type = ASR::down_cast(asr_type); + tuple_api->tuple_deepcopy(src, dest, tuple_type, module); + break ; + } + case ASR::ttypeType::List: { + ASR::List_t* list_type = ASR::down_cast(asr_type); + list_api->list_deepcopy(src, dest, list_type, module); + break ; + } + default: { + throw LCompilersException("LLVMUtils::deepcopy isn't implemented for " + + ASRUtils::type_to_str_python(asr_type)); + } + } + } + LLVMList::LLVMList(llvm::LLVMContext& context_, LLVMUtils* llvm_utils_, llvm::IRBuilder<>* builder_): @@ -162,6 +332,25 @@ namespace LFortran { llvm_utils(std::move(llvm_utils_)), builder(std::move(builder_)) {} + LLVMDict::LLVMDict(llvm::LLVMContext& context_, + LLVMUtils* llvm_utils_, + llvm::IRBuilder<>* builder_): + context(context_), + llvm_utils(std::move(llvm_utils_)), + builder(std::move(builder_)), + pos_ptr(nullptr), is_key_matching_var(nullptr), + idx_ptr(nullptr), hash_iter(nullptr), + hash_value(nullptr), polynomial_powers(nullptr), + are_iterators_set(false), is_dict_present(false) { + } + + LLVMDictOptimizedLinearProbing::LLVMDictOptimizedLinearProbing( + llvm::LLVMContext& context_, + LLVMUtils* llvm_utils_, + llvm::IRBuilder<>* builder_): + LLVMDict(context_, llvm_utils_, builder_) { + } + llvm::Type* LLVMList::get_list_type(llvm::Type* el_type, std::string& type_code, int32_t type_size) { if( typecode2listtype.find(type_code) != typecode2listtype.end() ) { @@ -175,6 +364,29 @@ namespace LFortran { return list_desc; } + llvm::Type* LLVMDict::get_dict_type(std::string key_type_code, std::string value_type_code, + int32_t key_type_size, int32_t value_type_size, + llvm::Type* key_type, llvm::Type* value_type) { + is_dict_present = true; + std::pair llvm_key = std::make_pair(key_type_code, value_type_code); + if( typecode2dicttype.find(llvm_key) != typecode2dicttype.end() ) { + return std::get<0>(typecode2dicttype[llvm_key]); + } + + llvm::Type* key_list_type = llvm_utils->list_api->get_list_type(key_type, + key_type_code, key_type_size); + llvm::Type* value_list_type = llvm_utils->list_api->get_list_type(value_type, + value_type_code, value_type_size); + std::vector dict_type_vec = {llvm::Type::getInt32Ty(context), + key_list_type, value_list_type, + llvm::Type::getInt8PtrTy(context)}; + llvm::Type* dict_desc = llvm::StructType::create(context, dict_type_vec, "dict"); + typecode2dicttype[llvm_key] = std::make_tuple(dict_desc, + std::make_pair(key_type_size, value_type_size), + std::make_pair(key_type, value_type)); + return dict_desc; + } + llvm::Value* LLVMList::get_pointer_to_list_data(llvm::Value* list) { return llvm_utils->create_gep(list, 2); } @@ -190,7 +402,7 @@ namespace LFortran { void LLVMList::list_init(std::string& type_code, llvm::Value* list, llvm::Module& module, int32_t initial_capacity, int32_t n) { if( typecode2listtype.find(type_code) == typecode2listtype.end() ) { - LCompilersException("list for " + type_code + " not declared yet."); + throw LCompilersException("list for " + type_code + " not declared yet."); } int32_t type_size = std::get<1>(typecode2listtype[type_code]); llvm::Value* arg_size = llvm::ConstantInt::get(context, @@ -208,10 +420,73 @@ namespace LFortran { builder->CreateStore(current_capacity, get_pointer_to_current_capacity(list)); } + void LLVMList::list_init(std::string& type_code, llvm::Value* list, + llvm::Module& module, llvm::Value* initial_capacity, + llvm::Value* n) { + if( typecode2listtype.find(type_code) == typecode2listtype.end() ) { + throw LCompilersException("list for " + type_code + " not declared yet."); + } + int32_t type_size = std::get<1>(typecode2listtype[type_code]); + llvm::Value* llvm_type_size = llvm::ConstantInt::get(context, llvm::APInt(32, type_size)); + llvm::Value* arg_size = builder->CreateMul(llvm_type_size, initial_capacity); + llvm::Value* list_data = LLVM::lfortran_malloc(context, module, *builder, arg_size); + + llvm::Type* el_type = std::get<2>(typecode2listtype[type_code]); + list_data = builder->CreateBitCast(list_data, el_type->getPointerTo()); + llvm::Value* list_data_ptr = get_pointer_to_list_data(list); + builder->CreateStore(list_data, list_data_ptr); + builder->CreateStore(n, get_pointer_to_current_end_point(list)); + builder->CreateStore(initial_capacity, get_pointer_to_current_capacity(list)); + } + + llvm::Value* LLVMDict::get_key_list(llvm::Value* dict) { + return llvm_utils->create_gep(dict, 1); + } + + llvm::Value* LLVMDict::get_value_list(llvm::Value* dict) { + return llvm_utils->create_gep(dict, 2); + } + + llvm::Value* LLVMDict::get_pointer_to_occupancy(llvm::Value* dict) { + return llvm_utils->create_gep(dict, 0); + } + + llvm::Value* LLVMDict::get_pointer_to_capacity(llvm::Value* dict) { + return llvm_utils->list_api->get_pointer_to_current_capacity( + get_value_list(dict)); + } + + void LLVMDict::dict_init(std::string key_type_code, std::string value_type_code, + llvm::Value* dict, llvm::Module* module, size_t initial_capacity) { + llvm::Value* n_ptr = get_pointer_to_occupancy(dict); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), n_ptr); + llvm::Value* key_list = get_key_list(dict); + llvm::Value* value_list = get_value_list(dict); + llvm_utils->list_api->list_init(key_type_code, key_list, *module, + initial_capacity, initial_capacity); + llvm_utils->list_api->list_init(value_type_code, value_list, *module, + initial_capacity, initial_capacity); + llvm::DataLayout data_layout(module); + size_t mask_size = data_layout.getTypeAllocSize(llvm::Type::getInt8Ty(context)); + llvm::Value* llvm_capacity = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, initial_capacity)); + llvm::Value* llvm_mask_size = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, mask_size)); + llvm::Value* key_mask = LLVM::lfortran_calloc(context, *module, *builder, llvm_capacity, + llvm_mask_size); + LLVM::CreateStore(*builder, key_mask, get_pointer_to_keymask(dict)); + } + + void LLVMList::list_deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::List_t* list_type, llvm::Module& module) { + list_deepcopy(src, dest, list_type->m_type, module); + } + void LLVMList::list_deepcopy(llvm::Value* src, llvm::Value* dest, - std::string& src_type_code, - llvm::Module& module) { + ASR::ttype_t* element_type, llvm::Module& module) { LFORTRAN_ASSERT(src->getType() == dest->getType()); + std::string src_type_code = ASRUtils::get_type_code(element_type); llvm::Value* src_end_point = LLVM::CreateLoad(*builder, get_pointer_to_current_end_point(src)); llvm::Value* src_capacity = LLVM::CreateLoad(*builder, get_pointer_to_current_capacity(src)); llvm::Value* dest_end_point_ptr = get_pointer_to_current_end_point(dest); @@ -226,18 +501,755 @@ namespace LFortran { arg_size); llvm::Type* el_type = std::get<2>(typecode2listtype[src_type_code]); copy_data = builder->CreateBitCast(copy_data, el_type->getPointerTo()); - builder->CreateMemCpy(copy_data, llvm::MaybeAlign(), src_data, - llvm::MaybeAlign(), arg_size); - builder->CreateStore(copy_data, get_pointer_to_list_data(dest)); + + // We consider the case when the element type of a list is defined by a struct + // which may also contain non-trivial structs (such as in case of list[list[f64]], + // list[tuple[f64]]). We need to make sure that all the data inside those structs + // is deepcopied and not just the address of the first element of those structs. + // Hence we dive deeper into the lowest level of nested types and deepcopy everything + // properly. If we don't consider this case then the data only from first level of nested types + // will be deep copied and rest will be shallow copied. The importance of this case + // can be figured out by goind through, integration_tests/test_list_06.py and + // integration_tests/test_list_07.py. + if( LLVM::is_llvm_struct(element_type) ) { + builder->CreateStore(copy_data, get_pointer_to_list_data(dest)); + // TODO: Should be created outside the user loop and not here. + // LLVMList should treat them as data members and create them + // only if they are NULL + llvm::AllocaInst *pos_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), + nullptr); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), pos_ptr); + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value *cond = builder->CreateICmpSGT( + src_end_point, + LLVM::CreateLoad(*builder, pos_ptr)); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* srci = read_item(src, pos, true); + llvm::Value* desti = read_item(dest, pos, true); + llvm_utils->deepcopy(srci, desti, element_type, module); + llvm::Value* tmp = builder->CreateAdd( + pos, + llvm::ConstantInt::get(context, llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, tmp, pos_ptr); + } + + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + } else { + builder->CreateMemCpy(copy_data, llvm::MaybeAlign(), src_data, + llvm::MaybeAlign(), arg_size); + builder->CreateStore(copy_data, get_pointer_to_list_data(dest)); + } + } + + void LLVMDict::dict_deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::Dict_t* dict_type, llvm::Module* module) { + LFORTRAN_ASSERT(src->getType() == dest->getType()); + llvm::Value* src_occupancy = LLVM::CreateLoad(*builder, get_pointer_to_occupancy(src)); + llvm::Value* dest_occupancy_ptr = get_pointer_to_occupancy(dest); + LLVM::CreateStore(*builder, src_occupancy, dest_occupancy_ptr); + + llvm::Value* src_key_list = get_key_list(src); + llvm::Value* dest_key_list = get_key_list(dest); + llvm_utils->list_api->list_deepcopy(src_key_list, dest_key_list, + dict_type->m_key_type, *module); + + llvm::Value* src_value_list = get_value_list(src); + llvm::Value* dest_value_list = get_value_list(dest); + llvm_utils->list_api->list_deepcopy(src_value_list, dest_value_list, + dict_type->m_value_type, *module); + + llvm::Value* src_key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(src)); + llvm::Value* dest_key_mask_ptr = get_pointer_to_keymask(dest); + llvm::DataLayout data_layout(module); + size_t mask_size = data_layout.getTypeAllocSize(llvm::Type::getInt8Ty(context)); + llvm::Value* llvm_mask_size = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, mask_size)); + llvm::Value* src_capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(src)); + llvm::Value* dest_key_mask = LLVM::lfortran_calloc(context, *module, *builder, src_capacity, + llvm_mask_size); + builder->CreateMemCpy(dest_key_mask, llvm::MaybeAlign(), src_key_mask, + llvm::MaybeAlign(), builder->CreateMul(src_capacity, llvm_mask_size)); + LLVM::CreateStore(*builder, dest_key_mask, dest_key_mask_ptr); } - void LLVMList::write_item(llvm::Value* list, llvm::Value* pos, llvm::Value* item) { + void LLVMList::check_index_within_bounds(llvm::Value* /*list*/, llvm::Value* /*pos*/) { + + } + + void LLVMList::write_item(llvm::Value* list, llvm::Value* pos, + llvm::Value* item, ASR::ttype_t* asr_type, + llvm::Module& module, bool check_index_bound) { + if( check_index_bound ) { + check_index_within_bounds(list, pos); + } llvm::Value* list_data = LLVM::CreateLoad(*builder, get_pointer_to_list_data(list)); llvm::Value* element_ptr = llvm_utils->create_ptr_gep(list_data, pos); - builder->CreateStore(item, element_ptr); + llvm_utils->deepcopy(item, element_ptr, asr_type, module); } - llvm::Value* LLVMList::read_item(llvm::Value* list, llvm::Value* pos, bool get_pointer) { + void LLVMList::write_item(llvm::Value* list, llvm::Value* pos, + llvm::Value* item, bool check_index_bound) { + if( check_index_bound ) { + check_index_within_bounds(list, pos); + } + llvm::Value* list_data = LLVM::CreateLoad(*builder, get_pointer_to_list_data(list)); + llvm::Value* element_ptr = llvm_utils->create_ptr_gep(list_data, pos); + LLVM::CreateStore(*builder, item, element_ptr); + } + + llvm::Value* LLVMDict::get_pointer_to_keymask(llvm::Value* dict) { + return llvm_utils->create_gep(dict, 3); + } + + void LLVMDict::set_iterators() { + if( are_iterators_set || !is_dict_present ) { + return ; + } + llvm_utils->set_iterators(); + pos_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr, "pos_ptr"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), pos_ptr); + is_key_matching_var = builder->CreateAlloca(llvm::Type::getInt1Ty(context), nullptr, + "is_key_matching_var"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt1Ty(context), + llvm::APInt(1, 0)), is_key_matching_var); + idx_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr, "idx_ptr"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), idx_ptr); + hash_value = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "hash_value"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), + llvm::APInt(64, 0)), hash_value); + hash_iter = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "hash_iter"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), + llvm::APInt(64, 0)), hash_iter); + polynomial_powers = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "p_pow"); + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), + llvm::APInt(64, 1)), polynomial_powers); + are_iterators_set = true; + } + + void LLVMDict::reset_iterators() { + llvm_utils->reset_iterators(); + pos_ptr = nullptr; + is_key_matching_var = nullptr; + idx_ptr = nullptr; + hash_iter = nullptr; + hash_value = nullptr; + polynomial_powers = nullptr; + are_iterators_set = false; + } + + void LLVMDict::resolve_collision( + llvm::Value* capacity, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* key_list, + llvm::Value* key_mask, llvm::Module& module, + ASR::ttype_t* key_asr_type, bool for_read) { + if( !are_iterators_set ) { + pos_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr); + is_key_matching_var = builder->CreateAlloca(llvm::Type::getInt1Ty(context), nullptr); + } + LLVM::CreateStore(*builder, key_hash, pos_ptr); + + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* key_mask_value = LLVM::CreateLoad(*builder, + llvm_utils->create_ptr_gep(key_mask, pos)); + llvm::Value* is_key_skip = builder->CreateICmpEQ(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 3))); + llvm::Value* is_key_set = builder->CreateICmpNE(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 0))); + llvm::Value* is_key_matching = llvm::ConstantInt::get(llvm::Type::getInt1Ty(context), + llvm::APInt(1, 0)); + LLVM::CreateStore(*builder, is_key_matching, is_key_matching_var); + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + llvm::Value* compare_keys = builder->CreateAnd(is_key_set, + builder->CreateNot(is_key_skip)); + builder->CreateCondBr(compare_keys, thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + llvm::Value* original_key = llvm_utils->list_api->read_item(key_list, pos, + LLVM::is_llvm_struct(key_asr_type), false); + is_key_matching = llvm_utils->is_equal_by_value(key, original_key, module, + key_asr_type); + LLVM::CreateStore(*builder, is_key_matching, is_key_matching_var); + } + builder->CreateBr(mergeBB); + + + llvm_utils->start_new_block(elseBB); + llvm_utils->start_new_block(mergeBB); + // TODO: Allow safe exit if pos becomes key_hash again. + // Ideally should not happen as dict will be resized once + // load factor touches a threshold (which will always be less than 1) + // so there will be some key which will not be set. However for safety + // we can add an exit from the loop with a error message. + llvm::Value *cond = nullptr; + if( for_read ) { + cond = builder->CreateAnd(is_key_set, builder->CreateNot( + LLVM::CreateLoad(*builder, is_key_matching_var))); + cond = builder->CreateOr(is_key_skip, cond); + } else { + cond = builder->CreateAnd(is_key_set, builder->CreateNot(is_key_skip)); + cond = builder->CreateAnd(cond, builder->CreateNot( + LLVM::CreateLoad(*builder, is_key_matching_var))); + } + builder->CreateCondBr(cond, loopbody, loopend); + } + + + // body + llvm_utils->start_new_block(loopbody); + { + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + pos = builder->CreateAdd(pos, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 1))); + pos = builder->CreateSRem(pos, capacity); + LLVM::CreateStore(*builder, pos, pos_ptr); + } + + + builder->CreateBr(loophead); + + + // end + llvm_utils->start_new_block(loopend); + } + + void LLVMDictOptimizedLinearProbing::resolve_collision( + llvm::Value* capacity, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* key_list, + llvm::Value* key_mask, llvm::Module& module, + ASR::ttype_t* key_asr_type, bool for_read) { + if( !are_iterators_set ) { + if( !for_read ) { + pos_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr); + } + is_key_matching_var = builder->CreateAlloca(llvm::Type::getInt1Ty(context), nullptr); + } + + LLVM::CreateStore(*builder, key_hash, pos_ptr); + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* key_mask_value = LLVM::CreateLoad(*builder, + llvm_utils->create_ptr_gep(key_mask, pos)); + llvm::Value* is_key_skip = builder->CreateICmpEQ(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 3))); + llvm::Value* is_key_set = builder->CreateICmpNE(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 0))); + llvm::Value* is_key_matching = llvm::ConstantInt::get(llvm::Type::getInt1Ty(context), + llvm::APInt(1, 0)); + LLVM::CreateStore(*builder, is_key_matching, is_key_matching_var); + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + llvm::Value* compare_keys = builder->CreateAnd(is_key_set, + builder->CreateNot(is_key_skip)); + builder->CreateCondBr(compare_keys, thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + llvm::Value* original_key = llvm_utils->list_api->read_item(key_list, pos, + LLVM::is_llvm_struct(key_asr_type), false); + is_key_matching = llvm_utils->is_equal_by_value(key, original_key, module, + key_asr_type); + LLVM::CreateStore(*builder, is_key_matching, is_key_matching_var); + } + builder->CreateBr(mergeBB); + + llvm_utils->start_new_block(elseBB); + llvm_utils->start_new_block(mergeBB); + // TODO: Allow safe exit if pos becomes key_hash again. + // Ideally should not happen as dict will be resized once + // load factor touches a threshold (which will always be less than 1) + // so there will be some key which will not be set. However for safety + // we can add an exit from the loop with a error message. + llvm::Value *cond = nullptr; + if( for_read ) { + cond = builder->CreateAnd(is_key_set, builder->CreateNot( + LLVM::CreateLoad(*builder, is_key_matching_var))); + cond = builder->CreateOr(is_key_skip, cond); + } else { + cond = builder->CreateAnd(is_key_set, builder->CreateNot(is_key_skip)); + cond = builder->CreateAnd(cond, builder->CreateNot( + LLVM::CreateLoad(*builder, is_key_matching_var))); + } + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + pos = builder->CreateAdd(pos, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 1))); + pos = builder->CreateSRem(pos, capacity); + LLVM::CreateStore(*builder, pos, pos_ptr); + } + + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + } + + void LLVMDict::resolve_collision_for_write( + llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* value, + llvm::Module& module, ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type) { + llvm::Value* key_list = get_key_list(dict); + llvm::Value* value_list = get_value_list(dict); + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::Value* capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + this->resolve_collision(capacity, key_hash, key, key_list, key_mask, module, key_asr_type); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm_utils->list_api->write_item(key_list, pos, key, + key_asr_type, module, false); + llvm_utils->list_api->write_item(value_list, pos, value, + value_asr_type, module, false); + llvm::Value* key_mask_value = LLVM::CreateLoad(*builder, + llvm_utils->create_ptr_gep(key_mask, pos)); + llvm::Value* is_slot_empty = builder->CreateICmpEQ(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 0))); + llvm::Value* occupancy_ptr = get_pointer_to_occupancy(dict); + is_slot_empty = builder->CreateZExt(is_slot_empty, llvm::Type::getInt32Ty(context)); + llvm::Value* occupancy = LLVM::CreateLoad(*builder, occupancy_ptr); + LLVM::CreateStore(*builder, builder->CreateAdd(occupancy, is_slot_empty), + occupancy_ptr); + LLVM::CreateStore(*builder, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 1)), + llvm_utils->create_ptr_gep(key_mask, pos)); + } + + void LLVMDictOptimizedLinearProbing::resolve_collision_for_write( + llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* value, + llvm::Module& module, ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type) { + llvm::Value* key_list = get_key_list(dict); + llvm::Value* value_list = get_value_list(dict); + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::Value* capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + this->resolve_collision(capacity, key_hash, key, key_list, key_mask, module, key_asr_type); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm_utils->list_api->write_item(key_list, pos, key, + key_asr_type, module, false); + llvm_utils->list_api->write_item(value_list, pos, value, + value_asr_type, module, false); + + llvm::Value* key_mask_value = LLVM::CreateLoad(*builder, + llvm_utils->create_ptr_gep(key_mask, pos)); + llvm::Value* is_slot_empty = builder->CreateICmpEQ(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 0))); + llvm::Value* occupancy_ptr = get_pointer_to_occupancy(dict); + is_slot_empty = builder->CreateZExt(is_slot_empty, llvm::Type::getInt32Ty(context)); + llvm::Value* occupancy = LLVM::CreateLoad(*builder, occupancy_ptr); + LLVM::CreateStore(*builder, builder->CreateAdd(occupancy, is_slot_empty), + occupancy_ptr); + + llvm::Value* linear_prob_happened = builder->CreateICmpNE(key_hash, pos); + linear_prob_happened = builder->CreateOr(linear_prob_happened, + builder->CreateICmpEQ( + LLVM::CreateLoad(*builder, llvm_utils->create_ptr_gep(key_mask, key_hash)), + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 2) + )) + ); + llvm::Value* set_max_2 = builder->CreateSelect(linear_prob_happened, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 2)), + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 1))); + LLVM::CreateStore(*builder, set_max_2, llvm_utils->create_ptr_gep(key_mask, key_hash)); + LLVM::CreateStore(*builder, set_max_2, llvm_utils->create_ptr_gep(key_mask, pos)); + } + + llvm::Value* LLVMDict::resolve_collision_for_read( + llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Module& module, + ASR::ttype_t* key_asr_type) { + llvm::Value* key_list = get_key_list(dict); + llvm::Value* value_list = get_value_list(dict); + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::Value* capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + this->resolve_collision(capacity, key_hash, key, key_list, key_mask, module, key_asr_type, true); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* item = llvm_utils->list_api->read_item(value_list, pos, true, false); + return item; + } + + llvm::Value* LLVMDictOptimizedLinearProbing::resolve_collision_for_read( + llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Module& module, + ASR::ttype_t* key_asr_type) { + llvm::Value* key_list = get_key_list(dict); + llvm::Value* value_list = get_value_list(dict); + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::Value* capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + if( !are_iterators_set ) { + pos_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr); + } + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + llvm::Value* key_mask_value = LLVM::CreateLoad(*builder, + llvm_utils->create_ptr_gep(key_mask, key_hash)); + llvm::Value* is_prob_not_neeeded = builder->CreateICmpEQ(key_mask_value, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 1))); + builder->CreateCondBr(is_prob_not_neeeded, thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + LLVM::CreateStore(*builder, key_hash, pos_ptr); + } + builder->CreateBr(mergeBB); + llvm_utils->start_new_block(elseBB); + { + this->resolve_collision(capacity, key_hash, key, key_list, key_mask, + module, key_asr_type, true); + } + llvm_utils->start_new_block(mergeBB); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* item = llvm_utils->list_api->read_item(value_list, pos, true, false); + return item; + } + + llvm::Value* LLVMDict::get_key_hash(llvm::Value* capacity, llvm::Value* key, + ASR::ttype_t* key_asr_type, llvm::Module& module) { + // Write specialised hash functions for intrinsic types + // This is to avoid unnecessary calls to C-runtime and do + // as much as possible in LLVM directly. + switch( key_asr_type->type ) { + case ASR::ttypeType::Integer: { + // Simple modulo with the capacity of the dict. + // We can update it later to do a better hash function + // which produces lesser collisions. + + llvm::Value* int_hash = builder->CreateZExtOrTrunc( + builder->CreateSRem(key, + builder->CreateZExtOrTrunc(capacity, key->getType())), + capacity->getType() + ); + return int_hash; + } + case ASR::ttypeType::Character: { + // Polynomial rolling hash function for strings + llvm::Value* null_char = llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), + llvm::APInt(8, '\0')); + llvm::Value* p = llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 31)); + llvm::Value* m = llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 100000009)); + if( !are_iterators_set ) { + hash_value = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "hash_value"); + hash_iter = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "hash_iter"); + polynomial_powers = builder->CreateAlloca(llvm::Type::getInt64Ty(context), nullptr, "p_pow"); + } + LLVM::CreateStore(*builder, + llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 0)), + hash_value); + LLVM::CreateStore(*builder, + llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 1)), + polynomial_powers); + LLVM::CreateStore(*builder, + llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 0)), + hash_iter); + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value* i = LLVM::CreateLoad(*builder, hash_iter); + llvm::Value* c = LLVM::CreateLoad(*builder, llvm_utils->create_ptr_gep(key, i)); + llvm::Value *cond = builder->CreateICmpNE(c, null_char); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + // for c in key: + // hash_value = (hash_value + (ord(c) + 1) * p_pow) % m + // p_pow = (p_pow * p) % m + llvm::Value* i = LLVM::CreateLoad(*builder, hash_iter); + llvm::Value* c = LLVM::CreateLoad(*builder, llvm_utils->create_ptr_gep(key, i)); + llvm::Value* p_pow = LLVM::CreateLoad(*builder, polynomial_powers); + llvm::Value* hash = LLVM::CreateLoad(*builder, hash_value); + c = builder->CreateZExt(c, llvm::Type::getInt64Ty(context)); + c = builder->CreateAdd(c, llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 1))); + c = builder->CreateMul(c, p_pow); + c = builder->CreateSRem(c, m); + hash = builder->CreateAdd(hash, c); + hash = builder->CreateSRem(hash, m); + LLVM::CreateStore(*builder, hash, hash_value); + p_pow = builder->CreateMul(p_pow, p); + p_pow = builder->CreateSRem(p_pow, m); + LLVM::CreateStore(*builder, p_pow, polynomial_powers); + i = builder->CreateAdd(i, llvm::ConstantInt::get(llvm::Type::getInt64Ty(context), llvm::APInt(64, 1))); + LLVM::CreateStore(*builder, i, hash_iter); + } + + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + llvm::Value* hash = LLVM::CreateLoad(*builder, hash_value); + hash = builder->CreateTrunc(hash, llvm::Type::getInt32Ty(context)); + return builder->CreateSRem(hash, capacity); + } + case ASR::ttypeType::Tuple: { + llvm::Value* tuple_hash = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), llvm::APInt(32, 0)); + ASR::Tuple_t* asr_tuple = ASR::down_cast(key_asr_type); + for( size_t i = 0; i < asr_tuple->n_type; i++ ) { + llvm::Value* llvm_tuple_i = llvm_utils->tuple_api->read_item(key, i, + LLVM::is_llvm_struct(asr_tuple->m_type[i])); + tuple_hash = builder->CreateAdd(tuple_hash, get_key_hash(capacity, llvm_tuple_i, + asr_tuple->m_type[i], module)); + tuple_hash = builder->CreateSRem(tuple_hash, capacity); + } + return tuple_hash; + } + default: { + throw LCompilersException("Hashing " + ASRUtils::type_to_str_python(key_asr_type) + + " isn't implemented yet."); + } + } + } + + void LLVMDict::rehash(llvm::Value* dict, llvm::Module* module, + ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type) { + llvm::Value* capacity_ptr = get_pointer_to_capacity(dict); + llvm::Value* old_capacity = LLVM::CreateLoad(*builder, capacity_ptr); + llvm::Value* capacity = builder->CreateMul(old_capacity, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 2))); + capacity = builder->CreateAdd(capacity, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, capacity, capacity_ptr); + + std::string key_type_code = ASRUtils::get_type_code(key_asr_type); + std::string value_type_code = ASRUtils::get_type_code(value_asr_type); + std::pair dict_type_key = std::make_pair(key_type_code, value_type_code); + llvm::Type* key_llvm_type = std::get<2>(typecode2dicttype[dict_type_key]).first; + llvm::Type* value_llvm_type = std::get<2>(typecode2dicttype[dict_type_key]).second; + int32_t key_type_size = std::get<1>(typecode2dicttype[dict_type_key]).first; + int32_t value_type_size = std::get<1>(typecode2dicttype[dict_type_key]).second; + + llvm::Value* key_list = get_key_list(dict); + llvm::Value* new_key_list = builder->CreateAlloca(llvm_utils->list_api->get_list_type(key_llvm_type, + key_type_code, key_type_size), nullptr); + llvm_utils->list_api->list_init(key_type_code, new_key_list, *module, capacity, capacity); + + llvm::Value* value_list = get_value_list(dict); + llvm::Value* new_value_list = builder->CreateAlloca(llvm_utils->list_api->get_list_type(value_llvm_type, + value_type_code, value_type_size), nullptr); + llvm_utils->list_api->list_init(value_type_code, new_value_list, *module, capacity, capacity); + + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::DataLayout data_layout(module); + size_t mask_size = data_layout.getTypeAllocSize(llvm::Type::getInt8Ty(context)); + llvm::Value* llvm_mask_size = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, mask_size)); + llvm::Value* new_key_mask = LLVM::lfortran_calloc(context, *module, *builder, capacity, + llvm_mask_size); + + llvm::Value* current_capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + if( !are_iterators_set ) { + idx_ptr = builder->CreateAlloca(llvm::Type::getInt32Ty(context), nullptr); + } + LLVM::CreateStore(*builder, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)), idx_ptr); + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value *cond = builder->CreateICmpSGT(old_capacity, LLVM::CreateLoad(*builder, idx_ptr)); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + llvm::Value* idx = LLVM::CreateLoad(*builder, idx_ptr); + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + llvm::Value* is_key_set = LLVM::CreateLoad(*builder, llvm_utils->create_ptr_gep(key_mask, idx)); + is_key_set = builder->CreateICmpNE(is_key_set, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 0))); + builder->CreateCondBr(is_key_set, thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + llvm::Value* key = llvm_utils->list_api->read_item(key_list, idx, + LLVM::is_llvm_struct(key_asr_type), false); + llvm::Value* value = llvm_utils->list_api->read_item(value_list, idx, + LLVM::is_llvm_struct(value_asr_type), false); + llvm::Value* key_hash = get_key_hash(current_capacity, key, key_asr_type, *module); + this->resolve_collision(current_capacity, key_hash, key, new_key_list, + new_key_mask, *module, key_asr_type); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* key_dest = llvm_utils->list_api->read_item(new_key_list, pos, + true, false); + llvm_utils->deepcopy(key, key_dest, key_asr_type, *module); + llvm::Value* value_dest = llvm_utils->list_api->read_item(new_value_list, pos, + true, false); + llvm_utils->deepcopy(value, value_dest, value_asr_type, *module); + + llvm::Value* linear_prob_happened = builder->CreateICmpNE(key_hash, pos); + llvm::Value* set_max_2 = builder->CreateSelect(linear_prob_happened, + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 2)), + llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 1))); + LLVM::CreateStore(*builder, set_max_2, llvm_utils->create_ptr_gep(new_key_mask, key_hash)); + LLVM::CreateStore(*builder, set_max_2, llvm_utils->create_ptr_gep(new_key_mask, pos)); + } + builder->CreateBr(mergeBB); + + llvm_utils->start_new_block(elseBB); + llvm_utils->start_new_block(mergeBB); + idx = builder->CreateAdd(idx, llvm::ConstantInt::get( + llvm::Type::getInt32Ty(context), llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, idx, idx_ptr); + } + + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + + // TODO: Free key_list, value_list and key_mask + llvm_utils->list_api->free_data(key_list, *module); + llvm_utils->list_api->free_data(value_list, *module); + LLVM::lfortran_free(context, *module, *builder, key_mask); + LLVM::CreateStore(*builder, LLVM::CreateLoad(*builder, new_key_list), key_list); + LLVM::CreateStore(*builder, LLVM::CreateLoad(*builder, new_value_list), value_list); + LLVM::CreateStore(*builder, new_key_mask, get_pointer_to_keymask(dict)); + } + + void LLVMDict::rehash_all_at_once_if_needed(llvm::Value* dict, llvm::Module* module, + ASR::ttype_t* key_asr_type, ASR::ttype_t* value_asr_type) { + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + + llvm::Value* occupancy = LLVM::CreateLoad(*builder, get_pointer_to_occupancy(dict)); + llvm::Value* capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + occupancy = builder->CreateAdd(occupancy, llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 1))); + occupancy = builder->CreateSIToFP(occupancy, llvm::Type::getFloatTy(context)); + capacity = builder->CreateSIToFP(capacity, llvm::Type::getFloatTy(context)); + llvm::Value* load_factor = builder->CreateFDiv(occupancy, capacity); + // Threshold hash is chosen from https://en.wikipedia.org/wiki/Hash_table#Load_factor + llvm::Value* load_factor_threshold = llvm::ConstantFP::get(llvm::Type::getFloatTy(context), + llvm::APFloat((float) 0.6)); + builder->CreateCondBr(builder->CreateFCmpOGE(load_factor, load_factor_threshold), thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + rehash(dict, module, key_asr_type, value_asr_type); + } + builder->CreateBr(mergeBB); + + llvm_utils->start_new_block(elseBB); + llvm_utils->start_new_block(mergeBB); + } + + void LLVMDict::write_item(llvm::Value* dict, llvm::Value* key, + llvm::Value* value, llvm::Module* module, + ASR::ttype_t* key_asr_type, ASR::ttype_t* value_asr_type) { + rehash_all_at_once_if_needed(dict, module, key_asr_type, value_asr_type); + llvm::Value* current_capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + llvm::Value* key_hash = get_key_hash(current_capacity, key, key_asr_type, *module); + this->resolve_collision_for_write(dict, key_hash, key, value, *module, + key_asr_type, value_asr_type); + } + + llvm::Value* LLVMDict::read_item(llvm::Value* dict, llvm::Value* key, + llvm::Module& module, ASR::ttype_t* key_asr_type, + bool get_pointer) { + llvm::Value* current_capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + llvm::Value* key_hash = get_key_hash(current_capacity, key, key_asr_type, module); + llvm::Value* value_ptr = this->resolve_collision_for_read(dict, key_hash, key, module, + key_asr_type); + if( get_pointer ) { + return value_ptr; + } + return LLVM::CreateLoad(*builder, value_ptr); + } + + llvm::Value* LLVMDict::pop_item(llvm::Value* dict, llvm::Value* key, + llvm::Module& module, ASR::Dict_t* dict_type, + bool get_pointer) { + llvm::Value* current_capacity = LLVM::CreateLoad(*builder, get_pointer_to_capacity(dict)); + llvm::Value* key_hash = get_key_hash(current_capacity, key, dict_type->m_key_type, module); + llvm::Value* value_ptr = this->resolve_collision_for_read(dict, key_hash, key, module, + dict_type->m_key_type); + llvm::Value* pos = LLVM::CreateLoad(*builder, pos_ptr); + llvm::Value* key_mask = LLVM::CreateLoad(*builder, get_pointer_to_keymask(dict)); + llvm::Value* key_mask_i = llvm_utils->create_ptr_gep(key_mask, pos); + llvm::Value* tombstone_marker = llvm::ConstantInt::get(llvm::Type::getInt8Ty(context), llvm::APInt(8, 3)); + LLVM::CreateStore(*builder, tombstone_marker, key_mask_i); + + llvm::Value* occupancy_ptr = get_pointer_to_occupancy(dict); + llvm::Value* occupancy = LLVM::CreateLoad(*builder, occupancy_ptr); + occupancy = builder->CreateSub(occupancy, llvm::ConstantInt::get( + llvm::Type::getInt32Ty(context), llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, occupancy, occupancy_ptr); + + if( get_pointer ) { + std::string key_type_code = ASRUtils::get_type_code(dict_type->m_key_type); + std::string value_type_code = ASRUtils::get_type_code(dict_type->m_value_type); + llvm::Type* llvm_value_type = std::get<2>(typecode2dicttype[std::make_pair( + key_type_code, value_type_code)]).second; + llvm::Value* return_ptr = builder->CreateAlloca(llvm_value_type, nullptr); + LLVM::CreateStore(*builder, LLVM::CreateLoad(*builder, value_ptr), return_ptr); + return return_ptr; + } + + return LLVM::CreateLoad(*builder, value_ptr); + } + + llvm::Value* LLVMList::read_item(llvm::Value* list, llvm::Value* pos, bool get_pointer, + bool check_index_bound) { + if( check_index_bound ) { + check_index_within_bounds(list, pos); + } llvm::Value* list_data = LLVM::CreateLoad(*builder, get_pointer_to_list_data(list)); llvm::Value* element_ptr = llvm_utils->create_ptr_gep(list_data, pos); if( get_pointer ) { @@ -250,6 +1262,16 @@ namespace LFortran { return LLVM::CreateLoad(*builder, get_pointer_to_current_end_point(list)); } + llvm::Value* LLVMDict::len(llvm::Value* dict) { + return LLVM::CreateLoad(*builder, get_pointer_to_occupancy(dict)); + } + + LLVMDict::~LLVMDict() { + typecode2dicttype.clear(); + } + + LLVMDictOptimizedLinearProbing::~LLVMDictOptimizedLinearProbing() {} + void LLVMList::resize_if_needed(llvm::Value* list, llvm::Value* n, llvm::Value* capacity, int32_t type_size, llvm::Type* el_type, llvm::Module& module) { @@ -287,18 +1309,255 @@ namespace LFortran { } void LLVMList::append(llvm::Value* list, llvm::Value* item, - llvm::Module& module, - std::string& type_code) { + ASR::ttype_t* asr_type, llvm::Module& module) { llvm::Value* current_end_point = LLVM::CreateLoad(*builder, get_pointer_to_current_end_point(list)); llvm::Value* current_capacity = LLVM::CreateLoad(*builder, get_pointer_to_current_capacity(list)); + std::string type_code = ASRUtils::get_type_code(asr_type); int type_size = std::get<1>(typecode2listtype[type_code]); llvm::Type* el_type = std::get<2>(typecode2listtype[type_code]); resize_if_needed(list, current_end_point, current_capacity, type_size, el_type, module); - write_item(list, current_end_point, item); + write_item(list, current_end_point, item, asr_type, module); shift_end_point_by_one(list); } + void LLVMList::insert_item(llvm::Value* list, llvm::Value* pos, + llvm::Value* item, ASR::ttype_t* asr_type, + llvm::Module& module) { + std::string type_code = ASRUtils::get_type_code(asr_type); + llvm::Value* current_end_point = LLVM::CreateLoad(*builder, + get_pointer_to_current_end_point(list)); + llvm::Value* current_capacity = LLVM::CreateLoad(*builder, + get_pointer_to_current_capacity(list)); + int type_size = std::get<1>(typecode2listtype[type_code]); + llvm::Type* el_type = std::get<2>(typecode2listtype[type_code]); + resize_if_needed(list, current_end_point, current_capacity, + type_size, el_type, module); + + /* While loop equivalent in C++: + * end_point // nth index of list + * pos // ith index to insert the element + * pos_ptr = pos; + * tmp_ptr = list[pos]; + * tmp = 0; + * + * while(end_point > pos_ptr) { + * tmp = list[pos + 1]; + * list[pos + 1] = tmp_ptr; + * tmp_ptr = tmp; + * pos_ptr++; + * } + * + * list[pos] = item; + */ + + // TODO: Should be created outside the user loop and not here. + // LLVMList should treat them as data members and create them + // only if they are NULL + llvm::AllocaInst *tmp_ptr = builder->CreateAlloca(el_type, nullptr); + LLVM::CreateStore(*builder, read_item(list, pos, false), tmp_ptr); + llvm::Value* tmp = nullptr; + + // TODO: Should be created outside the user loop and not here. + // LLVMList should treat them as data members and create them + // only if they are NULL + llvm::AllocaInst *pos_ptr = builder->CreateAlloca( + llvm::Type::getInt32Ty(context), nullptr); + LLVM::CreateStore(*builder, pos, pos_ptr); + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value *cond = builder->CreateICmpSGT( + current_end_point, + LLVM::CreateLoad(*builder, pos_ptr)); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + llvm::Value* next_index = builder->CreateAdd( + LLVM::CreateLoad(*builder, pos_ptr), + llvm::ConstantInt::get(context, llvm::APInt(32, 1))); + tmp = read_item(list, next_index, false); + write_item(list, next_index, LLVM::CreateLoad(*builder, tmp_ptr)); + LLVM::CreateStore(*builder, tmp, tmp_ptr); + + tmp = builder->CreateAdd( + LLVM::CreateLoad(*builder, pos_ptr), + llvm::ConstantInt::get(context, llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, tmp, pos_ptr); + } + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + + write_item(list, pos, item, asr_type, module); + shift_end_point_by_one(list); + } + + llvm::Value* LLVMList::find_item_position(llvm::Value* list, + llvm::Value* item, ASR::ttype_t* item_type, llvm::Module& module) { + llvm::Type* pos_type = llvm::Type::getInt32Ty(context); + llvm::Value* current_end_point = LLVM::CreateLoad(*builder, + get_pointer_to_current_end_point(list)); + // TODO: Should be created outside the user loop and not here. + // LLVMList should treat them as data members and create them + // only if they are NULL + llvm::AllocaInst *i = builder->CreateAlloca(pos_type, nullptr); + LLVM::CreateStore(*builder, llvm::ConstantInt::get( + context, llvm::APInt(32, 0)), i); + llvm::Value* tmp = nullptr; + + /* Equivalent in C++: + * int i = 0; + * while(list[i] != item && end_point > i) { + * i++; + * } + * + * if (i == end_point) { + * std::cout << "The list does not contain the element"; + * } + */ + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value* left_arg = read_item(list, LLVM::CreateLoad(*builder, i), + LLVM::is_llvm_struct(item_type)); + llvm::Value* is_item_not_equal = builder->CreateNot( + llvm_utils->is_equal_by_value( + left_arg, item, + module, item_type) + ); + llvm::Value *cond = builder->CreateAnd(is_item_not_equal, + builder->CreateICmpSGT(current_end_point, + LLVM::CreateLoad(*builder, i))); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + tmp = builder->CreateAdd( + LLVM::CreateLoad(*builder, i), + llvm::ConstantInt::get(context, llvm::APInt(32, 1))); + LLVM::CreateStore(*builder, tmp, i); + } + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + + + llvm::Function *fn = builder->GetInsertBlock()->getParent(); + llvm::BasicBlock *thenBB = llvm::BasicBlock::Create(context, "then", fn); + llvm::BasicBlock *elseBB = llvm::BasicBlock::Create(context, "else"); + llvm::BasicBlock *mergeBB = llvm::BasicBlock::Create(context, "ifcont"); + + llvm::Value* cond = builder->CreateICmpEQ( + LLVM::CreateLoad(*builder, i), current_end_point); + builder->CreateCondBr(cond, thenBB, elseBB); + builder->SetInsertPoint(thenBB); + { + // TODO: Allow runtime information like the exact element which is + // not found. + std::string message = "The list does not contain the element"; + llvm::Value *fmt_ptr = builder->CreateGlobalStringPtr("ValueError: %s\n"); + llvm::Value *fmt_ptr2 = builder->CreateGlobalStringPtr(message); + printf(context, module, *builder, {fmt_ptr, fmt_ptr2}); + int exit_code_int = 1; + llvm::Value *exit_code = llvm::ConstantInt::get(context, + llvm::APInt(32, exit_code_int)); + exit(context, module, *builder, exit_code); + } + builder->CreateBr(mergeBB); + + llvm_utils->start_new_block(elseBB); + llvm_utils->start_new_block(mergeBB); + + return LLVM::CreateLoad(*builder, i); + } + + void LLVMList::remove(llvm::Value* list, llvm::Value* item, + ASR::ttype_t* item_type, llvm::Module& module) { + llvm::Type* pos_type = llvm::Type::getInt32Ty(context); + llvm::Value* current_end_point = LLVM::CreateLoad(*builder, + get_pointer_to_current_end_point(list)); + // TODO: Should be created outside the user loop and not here. + // LLVMList should treat them as data members and create them + // only if they are NULL + llvm::AllocaInst *item_pos = builder->CreateAlloca(pos_type, nullptr); + llvm::Value* tmp = LLVMList::find_item_position(list, item, item_type, module); + LLVM::CreateStore(*builder, tmp, item_pos); + + /* While loop equivalent in C++: + * item_pos = find_item_position(); + * while(end_point > item_pos) { + * tmp = item_pos + 1; + * list[item_pos] = list[tmp]; + * item_pos = tmp; + * } + */ + + llvm::BasicBlock *loophead = llvm::BasicBlock::Create(context, "loop.head"); + llvm::BasicBlock *loopbody = llvm::BasicBlock::Create(context, "loop.body"); + llvm::BasicBlock *loopend = llvm::BasicBlock::Create(context, "loop.end"); + + // head + llvm_utils->start_new_block(loophead); + { + llvm::Value *cond = builder->CreateICmpSGT(current_end_point, + LLVM::CreateLoad(*builder, item_pos)); + builder->CreateCondBr(cond, loopbody, loopend); + } + + // body + llvm_utils->start_new_block(loopbody); + { + tmp = builder->CreateAdd( + LLVM::CreateLoad(*builder, item_pos), + llvm::ConstantInt::get(context, llvm::APInt(32, 1))); + write_item(list, LLVM::CreateLoad(*builder, item_pos), + read_item(list, tmp, false)); + LLVM::CreateStore(*builder, tmp, item_pos); + } + builder->CreateBr(loophead); + + // end + llvm_utils->start_new_block(loopend); + + // Decrement end point by one + llvm::Value* end_point_ptr = get_pointer_to_current_end_point(list); + llvm::Value* end_point = LLVM::CreateLoad(*builder, end_point_ptr); + end_point = builder->CreateSub(end_point, llvm::ConstantInt::get( + context, llvm::APInt(32, 1))); + builder->CreateStore(end_point, end_point_ptr); + } + + void LLVMList::list_clear(llvm::Value* list) { + llvm::Value* end_point_ptr = get_pointer_to_current_end_point(list); + llvm::Value* zero = llvm::ConstantInt::get(llvm::Type::getInt32Ty(context), + llvm::APInt(32, 0)); + LLVM::CreateStore(*builder, zero, end_point_ptr); + } + + void LLVMList::free_data(llvm::Value* list, llvm::Module& module) { + llvm::Value* data = LLVM::CreateLoad(*builder, get_pointer_to_list_data(list)); + LLVM::lfortran_free(context, module, *builder, data); + } + + LLVMTuple::LLVMTuple(llvm::LLVMContext& context_, LLVMUtils* llvm_utils_, llvm::IRBuilder<>* builder_) : @@ -339,14 +1598,31 @@ namespace LFortran { } void LLVMTuple::tuple_deepcopy(llvm::Value* src, llvm::Value* dest, - std::string& type_code) { + ASR::Tuple_t* tuple_type, llvm::Module& module) { LFORTRAN_ASSERT(src->getType() == dest->getType()); - size_t n_elements = typecode2tupletype[type_code].second; - for( size_t i = 0; i < n_elements; i++ ) { - llvm::Value* src_item = read_item(src, i, false); + for( size_t i = 0; i < tuple_type->n_type; i++ ) { + llvm::Value* src_item = read_item(src, i, LLVM::is_llvm_struct( + tuple_type->m_type[i])); llvm::Value* dest_item_ptr = read_item(dest, i, true); - builder->CreateStore(src_item, dest_item_ptr); + llvm_utils->deepcopy(src_item, dest_item_ptr, + tuple_type->m_type[i], module); + } + } + + llvm::Value* LLVMTuple::check_tuple_equality(llvm::Value* t1, llvm::Value* t2, + ASR::Tuple_t* tuple_type, + llvm::LLVMContext& context, + llvm::IRBuilder<>* builder, + llvm::Module& module) { + llvm::Value* is_equal = llvm::ConstantInt::get(context, llvm::APInt(1, 1)); + for( size_t i = 0; i < tuple_type->n_type; i++ ) { + llvm::Value* t1i = llvm_utils->tuple_api->read_item(t1, i); + llvm::Value* t2i = llvm_utils->tuple_api->read_item(t2, i); + llvm::Value* is_t1_eq_t2 = llvm_utils->is_equal_by_value(t1i, t2i, module, + tuple_type->m_type[i]); + is_equal = builder->CreateAnd(is_equal, is_t1_eq_t2); } + return is_equal; } } // namespace LFortran diff --git a/src/libasr/codegen/llvm_utils.h b/src/libasr/codegen/llvm_utils.h index bb5b72813f..5eaa428bfd 100644 --- a/src/libasr/codegen/llvm_utils.h +++ b/src/libasr/codegen/llvm_utils.h @@ -5,12 +5,40 @@ #include #include +#include #include #include namespace LFortran { + static inline void printf(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, const std::vector &args) + { + llvm::Function *fn_printf = module.getFunction("_lfortran_printf"); + if (!fn_printf) { + llvm::FunctionType *function_type = llvm::FunctionType::get( + llvm::Type::getVoidTy(context), {llvm::Type::getInt8PtrTy(context)}, true); + fn_printf = llvm::Function::Create(function_type, + llvm::Function::ExternalLinkage, "_lfortran_printf", &module); + } + builder.CreateCall(fn_printf, args); + } + + static inline void exit(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, llvm::Value* exit_code) + { + llvm::Function *fn_exit = module.getFunction("exit"); + if (!fn_exit) { + llvm::FunctionType *function_type = llvm::FunctionType::get( + llvm::Type::getVoidTy(context), {llvm::Type::getInt32Ty(context)}, + false); + fn_exit = llvm::Function::Create(function_type, + llvm::Function::ExternalLinkage, "exit", &module); + } + builder.CreateCall(fn_exit, {exit_code}); + } + namespace LLVM { llvm::Value* CreateLoad(llvm::IRBuilder<> &builder, llvm::Value *x); @@ -21,17 +49,38 @@ namespace LFortran { llvm::IRBuilder<> &builder, llvm::Value* arg_size); llvm::Value* lfortran_realloc(llvm::LLVMContext &context, llvm::Module &module, llvm::IRBuilder<> &builder, llvm::Value* ptr, llvm::Value* arg_size); + llvm::Value* lfortran_calloc(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, llvm::Value* count, llvm::Value* type_size); + llvm::Value* lfortran_free(llvm::LLVMContext &context, llvm::Module &module, + llvm::IRBuilder<> &builder, llvm::Value* ptr); + static inline bool is_llvm_struct(ASR::ttype_t* asr_type) { + return ASR::is_a(*asr_type) || + ASR::is_a(*asr_type) || + ASR::is_a(*asr_type) || + ASR::is_a(*asr_type); + } } + class LLVMList; + class LLVMTuple; + class LLVMDict; + class LLVMUtils { private: llvm::LLVMContext& context; llvm::IRBuilder<>* builder; + llvm::AllocaInst *str_cmp_itr; + + bool are_iterators_set; public: + LLVMTuple* tuple_api; + LLVMList* list_api; + LLVMDict* dict_api; + LLVMUtils(llvm::LLVMContext& context, llvm::IRBuilder<>* _builder); @@ -47,6 +96,19 @@ namespace LFortran { void start_new_block(llvm::BasicBlock *bb); + llvm::Value* lfortran_str_cmp(llvm::Value* left_arg, llvm::Value* right_arg, + std::string runtime_func_name, llvm::Module& module); + + llvm::Value* is_equal_by_value(llvm::Value* left, llvm::Value* right, + llvm::Module& module, ASR::ttype_t* asr_type); + + void set_iterators(); + + void reset_iterators(); + + void deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::ttype_t* asr_type, llvm::Module& module); + }; // LLVMUtils class LLVMList { @@ -67,11 +129,15 @@ namespace LFortran { public: LLVMList(llvm::LLVMContext& context_, LLVMUtils* llvm_utils, - llvm::IRBuilder<>* builder); + llvm::IRBuilder<>* builder); llvm::Type* get_list_type(llvm::Type* el_type, std::string& type_code, int32_t type_size); + void list_init(std::string& type_code, llvm::Value* list, + llvm::Module& module, llvm::Value* initial_capacity, + llvm::Value* n); + void list_init(std::string& type_code, llvm::Value* list, llvm::Module& module, int32_t initial_capacity=1, int32_t n=0); @@ -83,19 +149,44 @@ namespace LFortran { llvm::Value* get_pointer_to_current_capacity(llvm::Value* list); void list_deepcopy(llvm::Value* src, llvm::Value* dest, - std::string& src_type_code, + ASR::List_t* list_type, + llvm::Module& module); + + void list_deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::ttype_t* element_type, llvm::Module& module); llvm::Value* read_item(llvm::Value* list, llvm::Value* pos, - bool get_pointer=false); + bool get_pointer=false, bool check_index_bound=true); llvm::Value* len(llvm::Value* list); + void check_index_within_bounds(llvm::Value* list, llvm::Value* pos); + + void write_item(llvm::Value* list, llvm::Value* pos, + llvm::Value* item, ASR::ttype_t* asr_type, + llvm::Module& module, bool check_index_bound=true); + void write_item(llvm::Value* list, llvm::Value* pos, - llvm::Value* item); + llvm::Value* item, bool check_index_bound=true); void append(llvm::Value* list, llvm::Value* item, - llvm::Module& module, std::string& type_code); + ASR::ttype_t* asr_type, llvm::Module& module); + + void insert_item(llvm::Value* list, llvm::Value* pos, + llvm::Value* item, ASR::ttype_t* asr_type, + llvm::Module& module); + + void remove(llvm::Value* list, llvm::Value* item, + ASR::ttype_t* item_type, llvm::Module& module); + + void list_clear(llvm::Value* list); + + llvm::Value* find_item_position(llvm::Value* list, + llvm::Value* item, ASR::ttype_t* item_type, + llvm::Module& module); + + void free_data(llvm::Value* list, llvm::Module& module); }; class LLVMTuple { @@ -125,7 +216,133 @@ namespace LFortran { bool get_pointer=false); void tuple_deepcopy(llvm::Value* src, llvm::Value* dest, - std::string& type_code); + ASR::Tuple_t* type_code, llvm::Module& module); + + llvm::Value* check_tuple_equality(llvm::Value* t1, llvm::Value* t2, + ASR::Tuple_t* tuple_type, llvm::LLVMContext& context, + llvm::IRBuilder<>* builder, llvm::Module& module); + }; + + class LLVMDict { + protected: + + llvm::LLVMContext& context; + LLVMUtils* llvm_utils; + llvm::IRBuilder<>* builder; + llvm::AllocaInst *pos_ptr, *is_key_matching_var; + llvm::AllocaInst *idx_ptr, *hash_iter, *hash_value; + llvm::AllocaInst *polynomial_powers; + bool are_iterators_set; + + std::map, + std::tuple, + std::pair>> typecode2dicttype; + + public: + + bool is_dict_present; + + LLVMDict(llvm::LLVMContext& context_, + LLVMUtils* llvm_utils, + llvm::IRBuilder<>* builder); + + llvm::Type* get_dict_type(std::string key_type_code, std::string value_type_code, + int32_t key_type_size, int32_t value_type_size, + llvm::Type* key_type, llvm::Type* value_type); + + void dict_init(std::string key_type_code, std::string value_type_code, + llvm::Value* dict, llvm::Module* module, size_t initial_capacity); + + llvm::Value* get_key_list(llvm::Value* dict); + + llvm::Value* get_value_list(llvm::Value* dict); + + llvm::Value* get_pointer_to_occupancy(llvm::Value* dict); + + llvm::Value* get_pointer_to_capacity(llvm::Value* dict); + + llvm::Value* get_key_hash(llvm::Value* capacity, llvm::Value* key, + ASR::ttype_t* key_asr_type, llvm::Module& module); + + virtual + void resolve_collision(llvm::Value* capacity, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* key_list, + llvm::Value* key_mask, llvm::Module& module, + ASR::ttype_t* key_asr_type, bool for_read=false); + + virtual + void resolve_collision_for_write(llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* value, + llvm::Module& module, ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type); + + virtual + llvm::Value* resolve_collision_for_read(llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Module& module, + ASR::ttype_t* key_asr_type); + + void rehash(llvm::Value* dict, llvm::Module* module, + ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type); + + void rehash_all_at_once_if_needed(llvm::Value* dict, + llvm::Module* module, + ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type); + + void write_item(llvm::Value* dict, llvm::Value* key, + llvm::Value* value, llvm::Module* module, + ASR::ttype_t* key_asr_type, ASR::ttype_t* value_asr_type); + + llvm::Value* read_item(llvm::Value* dict, llvm::Value* key, + llvm::Module& module, ASR::ttype_t* key_asr_type, + bool get_pointer=false); + + llvm::Value* pop_item(llvm::Value* dict, llvm::Value* key, + llvm::Module& module, ASR::Dict_t* dict_type, + bool get_pointer=false); + + llvm::Value* get_pointer_to_keymask(llvm::Value* dict); + + void set_iterators(); + + void reset_iterators(); + + void dict_deepcopy(llvm::Value* src, llvm::Value* dest, + ASR::Dict_t* dict_type, llvm::Module* module); + + llvm::Value* len(llvm::Value* dict); + + virtual ~LLVMDict(); + }; + + class LLVMDictOptimizedLinearProbing: public LLVMDict { + + public: + + LLVMDictOptimizedLinearProbing(llvm::LLVMContext& context_, + LLVMUtils* llvm_utils, + llvm::IRBuilder<>* builder); + + virtual + void resolve_collision(llvm::Value* capacity, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* key_list, + llvm::Value* key_mask, llvm::Module& module, + ASR::ttype_t* key_asr_type, bool for_read=false); + + virtual + void resolve_collision_for_write(llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Value* value, + llvm::Module& module, ASR::ttype_t* key_asr_type, + ASR::ttype_t* value_asr_type); + + virtual + llvm::Value* resolve_collision_for_read(llvm::Value* dict, llvm::Value* key_hash, + llvm::Value* key, llvm::Module& module, + ASR::ttype_t* key_asr_type); + + virtual ~LLVMDictOptimizedLinearProbing(); + }; } // LFortran diff --git a/src/libasr/compiler_tester/tester.py b/src/libasr/compiler_tester/tester.py index b4e4760c1b..04e3186c0a 100644 --- a/src/libasr/compiler_tester/tester.py +++ b/src/libasr/compiler_tester/tester.py @@ -27,6 +27,7 @@ SRC_DIR = os.path.dirname(LIBASR_DIR) ROOT_DIR = os.path.dirname(SRC_DIR) + class RunException(Exception): pass @@ -183,6 +184,7 @@ def run(basename: str, cmd: Union[pathlib.Path, str], open(stderr_file, "wb").write(fixdir(r.stderr)) else: stderr_file = None + if infile: temp=unl_loop_del(open(infile, "rb").read()) infile_hash = hashlib.sha224(temp).hexdigest() @@ -195,7 +197,7 @@ def run(basename: str, cmd: Union[pathlib.Path, str], else: outfile_hash = None if stdout_file: - temp=unl_loop_del(open(stdout_file, "rb").read()) + temp = unl_loop_del(open(stdout_file, "rb").read()) stdout_hash = hashlib.sha224(temp).hexdigest() stdout_file = os.path.basename(stdout_file) else: @@ -278,10 +280,8 @@ def run_test(testname, basename, cmd, infile, update_reference=False, s = f"{testname} * {basename}" basename = bname(basename, cmd, infile) infile = os.path.join("tests", infile) - jo = run(basename, cmd, os.path.join("tests", "output"), infile=infile, extra_args=extra_args) - jr = os.path.join("tests", "reference", os.path.basename(jo)) if not os.path.exists(jo): raise FileNotFoundError( @@ -324,7 +324,6 @@ def run_test(testname, basename, cmd, infile, update_reference=False, raise RunException( "Testing with reference output failed." + full_err_str) - log.debug(s + " " + check()) def tester_main(compiler, single_test): @@ -348,7 +347,7 @@ def tester_main(compiler, single_test): verbose = args.verbose no_llvm = args.no_llvm - # So that the tests find the `lfortran` executable + # So that the tests find the `lcompiler` executable os.environ["PATH"] = os.path.join(SRC_DIR, "bin") \ + os.pathsep + os.environ["PATH"] test_data = toml.load(open(os.path.join(ROOT_DIR, "tests", "tests.toml"))) diff --git a/src/libasr/modfile.cpp b/src/libasr/modfile.cpp index ea5e3c159e..d8a6338919 100644 --- a/src/libasr/modfile.cpp +++ b/src/libasr/modfile.cpp @@ -64,6 +64,12 @@ std::string save_modfile(const ASR::TranslationUnit_t &m) { return asr_string; } +std::string save_pycfile(const ASR::TranslationUnit_t &m) { + std::string asr_string; + save_asr(m, asr_string); + return asr_string; +} + inline void load_serialised_asr(const std::string &s, std::string& asr_binary) { #ifdef WITH_LFORTRAN_BINARY_MODFILES BinaryReader b(s); @@ -91,4 +97,14 @@ ASR::TranslationUnit_t* load_modfile(Allocator &al, const std::string &s, return tu; } +ASR::TranslationUnit_t* load_pycfile(Allocator &al, const std::string &s, + bool load_symtab_id) { + std::string asr_binary; + load_serialised_asr(s, asr_binary); + ASR::asr_t *asr = deserialize_asr(al, asr_binary, load_symtab_id); + + ASR::TranslationUnit_t *tu = ASR::down_cast2(asr); + return tu; +} + } // namespace LFortran diff --git a/src/libasr/modfile.h b/src/libasr/modfile.h index deec7c9e2a..07aced4d69 100644 --- a/src/libasr/modfile.h +++ b/src/libasr/modfile.h @@ -8,10 +8,15 @@ namespace LFortran { // Save a module to a modfile std::string save_modfile(const ASR::TranslationUnit_t &m); + std::string save_pycfile(const ASR::TranslationUnit_t &m); + // Load a module from a modfile ASR::TranslationUnit_t* load_modfile(Allocator &al, const std::string &s, bool load_symtab_id, SymbolTable &symtab); + ASR::TranslationUnit_t* load_pycfile(Allocator &al, const std::string &s, + bool load_symtab_id); + } #endif // LFORTRAN_MODFILE_H diff --git a/src/libasr/pass/array_op.cpp b/src/libasr/pass/array_op.cpp index a2c273a8c1..48f443d275 100644 --- a/src/libasr/pass/array_op.cpp +++ b/src/libasr/pass/array_op.cpp @@ -132,7 +132,7 @@ class ArrayOpVisitor : public PassUtils::PassVisitor s->m_name, a_args.p, a_args.size(), nullptr, 0, s->m_body, s->n_body, nullptr, s->m_abi, s->m_access, s->m_deftype, nullptr, false, false, - false); + false, s->m_inline); ASR::symbol_t* s_sub = ASR::down_cast(s_sub_asr); return s_sub; } @@ -705,47 +705,55 @@ class ArrayOpVisitor : public PassUtils::PassVisitor if( doloop == nullptr ) { ASR::expr_t* ref = PassUtils::create_array_ref(arr_expr, idx_vars_value, al); ASR::expr_t* res = PassUtils::create_array_ref(result_var, idx_vars, al); + ASR::expr_t *lexpr = nullptr, *rexpr = nullptr; + if( rank_left > 0 ) { + lexpr = ref; + rexpr = other_expr; + } else { + rexpr = ref; + lexpr = other_expr; + } ASR::expr_t* op_el_wise = nullptr; switch( x.class_type ) { case ASR::exprType::IntegerBinOp: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_IntegerBinOp_t( al, x.base.base.loc, - ref, (ASR::binopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::binopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::RealBinOp: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_RealBinOp_t( al, x.base.base.loc, - ref, (ASR::binopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::binopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::ComplexBinOp: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_ComplexBinOp_t( al, x.base.base.loc, - ref, (ASR::binopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::binopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::LogicalBinOp: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_LogicalBinOp_t( al, x.base.base.loc, - ref, (ASR::logicalbinopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::logicalbinopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::IntegerCompare: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_IntegerCompare_t( al, x.base.base.loc, - ref, (ASR::cmpopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::cmpopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::RealCompare: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_RealCompare_t( al, x.base.base.loc, - ref, (ASR::cmpopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::cmpopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::ComplexCompare: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_ComplexCompare_t( al, x.base.base.loc, - ref, (ASR::cmpopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::cmpopType)x.m_op, rexpr, x.m_type, nullptr)); break; case ASR::exprType::LogicalCompare: op_el_wise = LFortran::ASRUtils::EXPR(ASR::make_LogicalCompare_t( al, x.base.base.loc, - ref, (ASR::cmpopType)x.m_op, other_expr, x.m_type, nullptr)); + lexpr, (ASR::cmpopType)x.m_op, rexpr, x.m_type, nullptr)); break; default: throw LCompilersException("The desired operation is not supported yet for arrays."); diff --git a/src/libasr/pass/global_stmts.cpp b/src/libasr/pass/global_stmts.cpp index 09c863612c..e0568fe9e0 100644 --- a/src/libasr/pass/global_stmts.cpp +++ b/src/libasr/pass/global_stmts.cpp @@ -121,7 +121,7 @@ void pass_wrap_global_stmts_into_function(Allocator &al, ASR::abiType::BindC, ASR::Public, ASR::Implementation, nullptr, - false, false, false); + false, false, false, false); std::string sym_name = fn_name; if (unit.m_global_scope->get_symbol(sym_name) != nullptr) { throw LCompilersException("Function already defined"); @@ -142,7 +142,7 @@ void pass_wrap_global_stmts_into_function(Allocator &al, nullptr, ASR::abiType::Source, ASR::Public, ASR::Implementation, nullptr, - false, false, false); + false, false, false, false); std::string sym_name = fn_name; if (unit.m_global_scope->get_symbol(sym_name) != nullptr) { throw LCompilersException("Function already defined"); diff --git a/src/libasr/pass/inline_function_calls.cpp b/src/libasr/pass/inline_function_calls.cpp index 491ca0b1f1..e5e24ed4b5 100644 --- a/src/libasr/pass/inline_function_calls.cpp +++ b/src/libasr/pass/inline_function_calls.cpp @@ -45,6 +45,7 @@ class InlineFunctionCallVisitor : public PassUtils::PassVisitorm_inline ) { + return ; + } + current_routine_scope = func->m_symtab; ASR::expr_t* return_var = nullptr; @@ -448,7 +455,7 @@ void pass_inline_function_calls(Allocator &al, ASR::TranslationUnit_t &unit, const LCompilers::PassOptions& pass_options) { std::string rl_path = pass_options.runtime_library_dir; bool inline_external_symbol_calls = pass_options.inline_external_symbol_calls; - InlineFunctionCallVisitor v(al, rl_path, inline_external_symbol_calls); + InlineFunctionCallVisitor v(al, rl_path, inline_external_symbol_calls, pass_options.fast); v.configure_node_duplicator(false); v.visit_TranslationUnit(unit); v.configure_node_duplicator(true); diff --git a/src/libasr/pass/instantiate_template.cpp b/src/libasr/pass/instantiate_template.cpp index ec9f98b4bb..028a43b286 100644 --- a/src/libasr/pass/instantiate_template.cpp +++ b/src/libasr/pass/instantiate_template.cpp @@ -8,25 +8,23 @@ namespace LFortran { class FunctionInstantiator : public ASR::BaseExprStmtDuplicator { -public: +public: SymbolTable *current_scope; std::map subs; - std::string new_function_name; + std::string new_func_name; - FunctionInstantiator(Allocator &al, std::map subs, - SymbolTable *current_scope, std::string new_function_name): + FunctionInstantiator(Allocator &al, std::map subs, + SymbolTable *current_scope, std::string new_func_name): BaseExprStmtDuplicator(al), current_scope{current_scope}, subs{subs}, - new_function_name{new_function_name} + new_func_name{new_func_name} {} ASR::asr_t* instantiate_Function(ASR::Function_t &x) { SymbolTable *parent_scope = current_scope; current_scope = al.make_new(parent_scope); - std::string func_name = new_function_name; - Vec args; args.reserve(al, x.n_args); for (size_t i=0; i( - (ASR::down_cast(x.m_return_var))->m_v); - std::string return_var_name = return_var->m_name; - ASR::ttype_t *return_param_type = ASRUtils::expr_type(x.m_return_var); - ASR::ttype_t *return_type = ASR::is_a(*return_param_type) ? - subs[ASR::down_cast(return_param_type)->m_param] : return_param_type; - ASR::asr_t *new_return_var = ASR::make_Variable_t(al, return_var->base.base.loc, - current_scope, s2c(al, return_var_name), return_var->m_intent, nullptr, nullptr, - return_var->m_storage, return_type, return_var->m_abi, return_var->m_access, - return_var->m_presence, return_var->m_value_attr); - current_scope->add_symbol(return_var_name, ASR::down_cast(new_return_var)); - ASR::asr_t *new_return_var_ref = ASR::make_Var_t(al, x.base.base.loc, - current_scope->get_symbol(return_var_name)); + ASR::expr_t *new_return_var_ref = nullptr; + if (x.m_return_var != nullptr) { + ASR::Variable_t *return_var = ASR::down_cast( + (ASR::down_cast(x.m_return_var))->m_v); + std::string return_var_name = return_var->m_name; + ASR::ttype_t *return_param_type = ASRUtils::expr_type(x.m_return_var); + ASR::ttype_t *return_type = substitute_type(return_param_type); + ASR::asr_t *new_return_var = ASR::make_Variable_t(al, return_var->base.base.loc, + current_scope, s2c(al, return_var_name), return_var->m_intent, nullptr, nullptr, + return_var->m_storage, return_type, return_var->m_abi, return_var->m_access, + return_var->m_presence, return_var->m_value_attr); + current_scope->add_symbol(return_var_name, ASR::down_cast(new_return_var)); + new_return_var_ref = ASRUtils::EXPR(ASR::make_Var_t(al, x.base.base.loc, + current_scope->get_symbol(return_var_name))); + } // Rebuild the symbol table for (auto const &sym_pair: x.m_symtab->get_scope()) { if (current_scope->resolve_symbol(sym_pair.first) == nullptr) { ASR::symbol_t *sym = sym_pair.second; - ASR::ttype_t *new_sym_type = substitute_type(ASRUtils::symbol_type(sym)); if (ASR::is_a(*sym)) { + ASR::ttype_t *new_sym_type = substitute_type(ASRUtils::symbol_type(sym)); ASR::Variable_t *var_sym = ASR::down_cast(sym); std::string var_sym_name = var_sym->m_name; ASR::asr_t *new_var = ASR::make_Variable_t(al, var_sym->base.base.loc, @@ -103,21 +103,23 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator(result); - parent_scope->add_symbol(func_name, t); + parent_scope->add_symbol(new_func_name, t); current_scope = parent_scope; return result; } + + ASR::asr_t* duplicate_Var(ASR::Var_t *x) { std::string sym_name = ASRUtils::symbol_name(x->m_v); ASR::symbol_t *sym = current_scope->get_symbol(sym_name); @@ -127,7 +129,7 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicatorm_v); ASR::expr_t *m_value = duplicate_expr(x->m_value); - + Vec args; args.reserve(al, x->n_args); for (size_t i=0; in_args; i++) { @@ -139,6 +141,16 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicatorbase.base.loc, m_v, args.p, x->n_args, type, m_value); } + ASR::asr_t* duplicate_ListItem(ASR::ListItem_t *x) { + ASR::expr_t *m_a = duplicate_expr(x->m_a); + ASR::expr_t *m_pos = duplicate_expr(x->m_pos); + ASR::ttype_t *type = substitute_type(x->m_type); + ASR::expr_t *m_value = duplicate_expr(x->m_value); + + return ASR::make_ListItem_t(al, x->base.base.loc, + m_a, m_pos, type, m_value); + } + ASR::array_index_t duplicate_array_index(ASR::array_index_t x) { ASR::expr_t *left = duplicate_expr(x.m_left); ASR::expr_t *right = duplicate_expr(x.m_right); @@ -150,11 +162,26 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicatorm_target); + ASR::ttype_t *target_type = substitute_type(ASRUtils::expr_type(x->m_target)); + ASR::expr_t *value = duplicate_expr(x->m_value); + if (ASRUtils::is_real(*target_type) && ASR::is_a(*x->m_value)) { + ASR::IntegerConstant_t *int_value = ASR::down_cast(x->m_value); + if (int_value->m_n == 0) { + value = ASRUtils::EXPR(ASR::make_RealConstant_t(al, value->base.loc, 0, + ASRUtils::duplicate_type(al, target_type))); + } + } + ASR::stmt_t *overloaded = duplicate_stmt(x->m_overloaded); + return ASR::make_Assignment_t(al, x->base.base.loc, target, value, overloaded); + } + ASR::asr_t* duplicate_TemplateBinOp(ASR::TemplateBinOp_t *x) { ASR::expr_t *left = duplicate_expr(x->m_left); ASR::expr_t *right = duplicate_expr(x->m_right); - return make_BinOp_helper(left, right, x->m_op, x->base.base.loc); + return make_BinOp_helper(left, right, x->m_op, x->base.base.loc); } ASR::asr_t* duplicate_DoLoop(ASR::DoLoop_t *x) { @@ -172,11 +199,20 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicatorbase.base.loc, head, m_body.p, x->n_body); } + ASR::asr_t* duplicate_Cast(ASR::Cast_t *x) { + ASR::expr_t *arg = duplicate_expr(x->m_arg); + ASR::ttype_t *type = substitute_type(ASRUtils::expr_type(x->m_arg)); + if (ASRUtils::is_real(*type)) { + return (ASR::asr_t*) arg; + } + return ASRUtils::make_Cast_t_value(al, x->base.base.loc, arg, ASR::cast_kindType::IntegerToReal, x->m_type); + } + ASR::ttype_t* substitute_type(ASR::ttype_t *param_type) { if (ASR::is_a(*param_type)) { - ASR::List_t *list_type = ASR::down_cast(param_type); - ASR::ttype_t *elem_type = substitute_type(list_type->m_type); - return ASRUtils::TYPE(ASR::make_List_t(al, param_type->base.loc, elem_type)); + ASR::List_t *tlist = ASR::down_cast(param_type); + return ASRUtils::TYPE(ASR::make_List_t(al, param_type->base.loc, + substitute_type(tlist->m_type))); } if (ASR::is_a(*param_type)) { ASR::TypeParameter_t *param = ASR::down_cast(param_type); @@ -191,28 +227,26 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator(t); return ASRUtils::TYPE(ASR::make_Real_t(al, t->base.loc, tnew->m_kind, param->m_dims, param->n_dims)); - } + } case ASR::ttypeType::Character: { ASR::Character_t* tnew = ASR::down_cast(t); return ASRUtils::TYPE(ASR::make_Character_t(al, t->base.loc, tnew->m_kind, tnew->m_len, tnew->m_len_expr, param->m_dims, param->n_dims)); - } - default: return subs[param->m_param]; + } + default: return subs[param->m_param]; } } return param_type; - } - + } + + // Commented out part is not yet considered for generic functions ASR::asr_t* make_BinOp_helper(ASR::expr_t *left, ASR::expr_t *right, ASR::binopType op, const Location &loc) { ASR::ttype_t *left_type = ASRUtils::expr_type(left); ASR::ttype_t *right_type = ASRUtils::expr_type(right); ASR::ttype_t *dest_type = nullptr; ASR::expr_t *value = nullptr; - - // bool right_is_int = ASRUtils::is_character(*left_type) && ASRUtils::is_integer(*right_type); - // bool left_is_int = ASRUtils::is_integer(*left_type) && ASRUtils::is_character(*right_type); if ((ASRUtils::is_integer(*left_type) || ASRUtils::is_real(*left_type) || ASRUtils::is_complex(*left_type) || ASRUtils::is_logical(*left_type)) && @@ -223,7 +257,6 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator(left_type); ASR::Character_t *right_type2 = ASR::down_cast(right_type); LFORTRAN_ASSERT(left_type2->n_dims == 0); @@ -250,9 +283,10 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator> right_value; break; } + */ default: { LFORTRAN_ASSERT(false); } // should never happen } value = ASR::down_cast(ASR::make_IntegerConstant_t(al, loc, result, dest_type)); } return ASR::make_IntegerBinOp_t(al, loc, left, op, right, dest_type, value); } else if (ASRUtils::is_real(*dest_type)) { + /* if (op == ASR::binopType::BitAnd || op == ASR::binopType::BitOr || op == ASR::binopType::BitXor || op == ASR::binopType::BitLShift || op == ASR::binopType::BitRShift) { throw LCompilersException("ICE: failure in instantiation: Unsupported binary operation on floats: '" + ASRUtils::binop_to_str_python(op) + "'"); } + */ right = cast_helper(left_type, right); dest_type = ASRUtils::expr_type(right); if (ASRUtils::expr_value(left) != nullptr && ASRUtils::expr_value(right) != nullptr) { @@ -299,9 +336,9 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator(ASR::make_RealConstant_t(al, loc, result, dest_type)); } return ASR::make_RealBinOp_t(al, loc, left, op, right, dest_type, value); - } + } - return nullptr; + return nullptr; } ASR::expr_t *cast_helper(ASR::ttype_t *left_type, ASR::expr_t *right, @@ -317,12 +354,12 @@ class FunctionInstantiator : public ASR::BaseExprStmtDuplicator subs, - SymbolTable *current_scope, std::string new_function_name, ASR::Function_t &func) { - FunctionInstantiator tf(al, subs, current_scope, new_function_name); + SymbolTable *current_scope, std::string new_func_name, ASR::Function_t &func) { + FunctionInstantiator tf(al, subs, current_scope, new_func_name); ASR::asr_t *new_function = tf.instantiate_Function(func); return ASR::down_cast(new_function); } diff --git a/src/libasr/pass/instantiate_template.h b/src/libasr/pass/instantiate_template.h index 28f0906da1..f6752da200 100644 --- a/src/libasr/pass/instantiate_template.h +++ b/src/libasr/pass/instantiate_template.h @@ -6,7 +6,7 @@ namespace LFortran { ASR::symbol_t* pass_instantiate_generic_function(Allocator &al, std::map subs, - SymbolTable *current_scope, std::string new_function_name, ASR::Function_t &func); + SymbolTable *current_scope, std::string new_func_name, ASR::Function_t &func); } #endif // LFORTRAN_PASS_TEMPLATE_VISITOR_H \ No newline at end of file diff --git a/src/libasr/pass/pass_array_by_data.cpp b/src/libasr/pass/pass_array_by_data.cpp index 53bd24a14c..cdffdd6e30 100644 --- a/src/libasr/pass/pass_array_by_data.cpp +++ b/src/libasr/pass/pass_array_by_data.cpp @@ -13,25 +13,23 @@ namespace LFortran { /* - The following visitor converts function/subroutines (a.k.a procedures) with array arguments having empty dimensions to arrays having dimensional information available from function arguments. See example below, -subroutine f(array1, array2) - integer, intent(in) :: array1(:) - integer, intent(out) :: array2(:) -end subroutine + subroutine f(array1, array2) + integer, intent(in) :: array1(:) + integer, intent(out) :: array2(:) + end subroutine gets converted to, -subroutine f_array1_array2(array1, m1, n1, array2, m2, n2) - integer, intent(in) :: m1, m2, n1, n2 - integer, intent(in) :: array1(m1:n1) - integer, intent(out) :: array2(m2:n2) -end subroutine - -*/ + subroutine f_array1_array2(array1, m1, n1, array2, m2, n2) + integer, intent(in) :: m1, m2, n1, n2 + integer, intent(in) :: array1(m1:n1) + integer, intent(out) :: array2(m2:n2) + end subroutine + */ class PassArrayByDataProcedureVisitor : public PassUtils::PassVisitor { private: @@ -155,7 +153,7 @@ class PassArrayByDataProcedureVisitor : public PassUtils::PassVisitorm_abi, x->m_access, x->m_deftype, s2c(al, new_bindc_name), x->m_elemental, - x->m_pure, x->m_module); + x->m_pure, x->m_module, x->m_inline); new_symbol = ASR::down_cast(new_subrout); } current_scope->add_symbol(new_name, new_symbol); @@ -227,20 +225,18 @@ class PassArrayByDataProcedureVisitor : public PassUtils::PassVisitor { private: @@ -289,17 +285,18 @@ class ReplaceSubroutineCallsVisitor : public PassUtils::PassVisitor { @@ -352,11 +349,9 @@ class ReplaceFunctionCalls: public ASR::BaseExprReplacer { }; /* - The following visitor calls the above replacer i.e., ReplaceFunctionCalls on expressions present in ASR so that FunctionCall get replaced everywhere and we don't end up with false positives. - */ class ReplaceFunctionCallsVisitor : public ASR::CallReplacerOnExpressionsVisitor { @@ -377,14 +372,12 @@ class ReplaceFunctionCallsVisitor : public ASR::CallReplacerOnExpressionsVisitor }; /* - Since the above visitors have replaced procedure and calls to those procedures with arrays as arguments, we don't need the original ones anymore. So we remove them from the ASR. The reason to do this is that some backends like WASM don't have support for accepting and returning arrays via array descriptors. Therefore, they cannot generate code for such functions. To avoid backends like WASM from failing we remove those functions by implementing and calling the following visitor. - */ class RemoveArrayByDescriptorProceduresVisitor : public PassUtils::PassVisitor { @@ -400,6 +393,7 @@ class RemoveArrayByDescriptorProceduresVisitor : public PassUtils::PassVisitor(x); current_scope = xx.m_symtab; + std::vector to_be_erased; for( auto& item: current_scope->get_scope() ) { diff --git a/src/libasr/pass/pass_manager.h b/src/libasr/pass/pass_manager.h index 5aa72d0c8f..b18ea5b474 100644 --- a/src/libasr/pass/pass_manager.h +++ b/src/libasr/pass/pass_manager.h @@ -101,6 +101,7 @@ namespace LCompilers { "do_loops", "forall", "select_case", + "inline_function_calls", "unused_functions" }; @@ -161,8 +162,10 @@ namespace LCompilers { void apply_passes(Allocator& al, LFortran::ASR::TranslationUnit_t* asr, PassOptions& pass_options) { if( !_user_defined_passes.empty() ) { + pass_options.fast = true; _apply_passes(al, asr, _user_defined_passes, pass_options); } else if( apply_default_passes ) { + pass_options.fast = is_fast; if( is_fast ) { _apply_passes(al, asr, _with_optimization_passes, pass_options); } else { diff --git a/src/libasr/pass/pass_utils.cpp b/src/libasr/pass/pass_utils.cpp index 0a92ca2d4e..ff9dffcf09 100644 --- a/src/libasr/pass/pass_utils.cpp +++ b/src/libasr/pass/pass_utils.cpp @@ -540,7 +540,7 @@ namespace LFortran { nullptr, 0, body.p, body.size(), nullptr, ASR::abiType::Source, ASR::accessType::Public, ASR::deftypeType::Implementation, - nullptr, false, false, false); + nullptr, false, false, false, false); global_scope->add_symbol(vector_copy_name, ASR::down_cast(vector_copy_asr)); return ASR::down_cast(vector_copy_asr); } diff --git a/src/libasr/pass/pass_utils.h b/src/libasr/pass/pass_utils.h index 8f13a48731..14df3c02e9 100644 --- a/src/libasr/pass/pass_utils.h +++ b/src/libasr/pass/pass_utils.h @@ -159,6 +159,12 @@ namespace LFortran { transform_stmts(xx.m_body, xx.n_body); } + void visit_Block(const ASR::Block_t& x) { + ASR::Block_t &xx = const_cast(x); + current_scope = xx.m_symtab; + transform_stmts(xx.m_body, xx.n_body); + } + }; template diff --git a/src/libasr/runtime/lfortran_intrinsics.c b/src/libasr/runtime/lfortran_intrinsics.c index 17399c7844..38b5dadbe8 100644 --- a/src/libasr/runtime/lfortran_intrinsics.c +++ b/src/libasr/runtime/lfortran_intrinsics.c @@ -732,7 +732,7 @@ LFORTRAN_API int32_t _lpython_bit_length4(int32_t num) LFORTRAN_API int32_t _lpython_bit_length8(int64_t num) { int32_t res = 0; - num = abs(num); + num = llabs(num); for(; num; num >>= 1, res++); return res; } @@ -860,6 +860,10 @@ LFORTRAN_API int8_t* _lfortran_realloc(int8_t* ptr, int32_t size) { return (int8_t*) realloc(ptr, size); } +LFORTRAN_API int8_t* _lfortran_calloc(int32_t count, int32_t size) { + return (int8_t*) calloc(count, size); +} + LFORTRAN_API void _lfortran_free(char* ptr) { free((void*)ptr); } diff --git a/src/libasr/runtime/lfortran_intrinsics.h b/src/libasr/runtime/lfortran_intrinsics.h index baccb85bff..e1785a2b85 100644 --- a/src/libasr/runtime/lfortran_intrinsics.h +++ b/src/libasr/runtime/lfortran_intrinsics.h @@ -160,6 +160,8 @@ LFORTRAN_API int _lfortran_str_ord(char** s); LFORTRAN_API char* _lfortran_str_chr(int c); LFORTRAN_API int _lfortran_str_to_int(char** s); LFORTRAN_API char* _lfortran_malloc(int size); +LFORTRAN_API int8_t* _lfortran_realloc(int8_t* ptr, int32_t size); +LFORTRAN_API int8_t* _lfortran_calloc(int32_t count, int32_t size); LFORTRAN_API void _lfortran_free(char* ptr); LFORTRAN_API void _lfortran_string_init(int size_plus_one, char *s); LFORTRAN_API int32_t _lfortran_iand32(int32_t x, int32_t y); diff --git a/src/libasr/serialization.cpp b/src/libasr/serialization.cpp index 569b4829e7..84c9630153 100644 --- a/src/libasr/serialization.cpp +++ b/src/libasr/serialization.cpp @@ -307,7 +307,12 @@ void fix_external_symbols(ASR::TranslationUnit_t &unit, } ASR::asr_t* deserialize_asr(Allocator &al, const std::string &s, - bool load_symtab_id, SymbolTable &external_symtab) { + bool load_symtab_id, SymbolTable & /*external_symtab*/) { + return deserialize_asr(al, s, load_symtab_id); +} + +ASR::asr_t* deserialize_asr(Allocator &al, const std::string &s, + bool load_symtab_id) { ASRDeserializationVisitor v(al, s, load_symtab_id); ASR::asr_t *node = v.deserialize_node(); ASR::TranslationUnit_t *tu = ASR::down_cast2(node); @@ -319,9 +324,6 @@ ASR::asr_t* deserialize_asr(Allocator &al, const std::string &s, LFORTRAN_ASSERT(asr_verify(*tu, false)); - // Suppress a warning for now - if ((bool&)external_symtab) {} - return node; } diff --git a/src/libasr/serialization.h b/src/libasr/serialization.h index 7b054ed2d7..3e04b0f98e 100644 --- a/src/libasr/serialization.h +++ b/src/libasr/serialization.h @@ -9,6 +9,8 @@ namespace LFortran { std::string serialize(const ASR::TranslationUnit_t &unit); ASR::asr_t* deserialize_asr(Allocator &al, const std::string &s, bool load_symtab_id, SymbolTable &symtab); + ASR::asr_t* deserialize_asr(Allocator &al, const std::string &s, + bool load_symtab_id); void fix_external_symbols(ASR::TranslationUnit_t &unit, SymbolTable &external_symtab); diff --git a/src/libasr/utils.h b/src/libasr/utils.h index 158055acd8..b7bccc8b42 100644 --- a/src/libasr/utils.h +++ b/src/libasr/utils.h @@ -35,6 +35,7 @@ struct CompilerOptions { std::string error_format = "human"; bool new_parser = false; bool implicit_typing = false; + bool implicit_interface = false; std::string target = ""; Platform platform; @@ -55,9 +56,10 @@ namespace LCompilers { bool always_run; // for unused_functions pass bool inline_external_symbol_calls; // for inline_function_calls pass int64_t unroll_factor; // for loop_unroll pass + bool fast; // is fast flag enabled. PassOptions(): always_run(false), inline_external_symbol_calls(true), - unroll_factor(32) + unroll_factor(32), fast(false) {} }; diff --git a/src/runtime/pure/lfortran_intrinsic_math2.f90 b/src/runtime/pure/lfortran_intrinsic_math2.f90 index 143f763bb8..6b3324fba3 100644 --- a/src/runtime/pure/lfortran_intrinsic_math2.f90 +++ b/src/runtime/pure/lfortran_intrinsic_math2.f90 @@ -37,11 +37,11 @@ module lfortran_intrinsic_math2 end interface interface min - module procedure imin, imin8, imin16, imin64, smin, dmin, imin_6args + module procedure imin, imin8, imin16, imin64, smin, dmin, dmin1, imin_6args end interface interface max - module procedure imax, imax8, imax16, imax64, smax, dmax, imax_6args + module procedure imax, imax8, imax16, imax64, smax, dmax, dmax1, imax_6args, dmax_3args end interface interface huge @@ -315,6 +315,15 @@ elemental real(dp) function dmin(x, y) result(r) end if end function +elemental real(dp) function dmin1(x, y) result(r) +real(dp), intent(in) :: x, y +if (x < y) then + r = x +else + r = y +end if +end function + elemental integer function imin_6args(a, b, c, d, e, f) result(r) integer, intent(in) :: a, b, c, d, e, f integer :: args(6) @@ -423,6 +432,21 @@ elemental real(dp) function dmax(x, y) result(r) end if end function +elemental real(dp) function dmax1(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 dmax_3args(x, y, z) result(r) +real(dp), intent(in) :: x, y, z +r = dmax(x, y) +r = dmax(r, z) +end function + ! huge ------------------------------------------------------------------------- elemental integer(i32) function i32huge(x) result(r) diff --git a/tests/allow_implicit_interface.f90 b/tests/allow_implicit_interface.f90 new file mode 100644 index 0000000000..5729c267f5 --- /dev/null +++ b/tests/allow_implicit_interface.f90 @@ -0,0 +1,11 @@ +double 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 diff --git a/tests/continue_body_if_loop.f b/tests/continue_body_if_loop.f new file mode 100644 index 0000000000..8d60461a4f --- /dev/null +++ b/tests/continue_body_if_loop.f @@ -0,0 +1,11 @@ + 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 diff --git a/tests/fixed_form_call1.f b/tests/fixed_form_call1.f new file mode 100644 index 0000000000..40f6f7c03b --- /dev/null +++ b/tests/fixed_form_call1.f @@ -0,0 +1,6 @@ + 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 diff --git a/tests/fixed_form_call2.f b/tests/fixed_form_call2.f new file mode 100644 index 0000000000..1d9cbbea80 --- /dev/null +++ b/tests/fixed_form_call2.f @@ -0,0 +1,8 @@ + subroutine idd_frm(m) + integer m, a + a = 2 + call prinf('lw = *',1) + call prinf('16m+70 = *',1) + m = 1 + return + end diff --git a/tests/fixed_form_call3.f b/tests/fixed_form_call3.f new file mode 100644 index 0000000000..36479b64fb --- /dev/null +++ b/tests/fixed_form_call3.f @@ -0,0 +1,7 @@ +c 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 diff --git a/tests/fixed_form_goto_select.f b/tests/fixed_form_goto_select.f new file mode 100644 index 0000000000..1b710780b9 --- /dev/null +++ b/tests/fixed_form_goto_select.f @@ -0,0 +1,12 @@ + 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 diff --git a/tests/fixed_form_simple_continue.f b/tests/fixed_form_simple_continue.f new file mode 100644 index 0000000000..b71bed51c7 --- /dev/null +++ b/tests/fixed_form_simple_continue.f @@ -0,0 +1,3 @@ + continue + end + diff --git a/tests/loop_test1.f b/tests/loop_test1.f index e875be8629..5cd4a2d5b4 100644 --- a/tests/loop_test1.f +++ b/tests/loop_test1.f @@ -1,6 +1,7 @@ program main integer KP kp =10 + integer i,j DO 330 I=1,KP DO 320 J=I+1,KP IF (0.GT.1) THEN diff --git a/tests/loop_test2.f b/tests/loop_test2.f index 89bbf63fd7..8cd780998e 100644 --- a/tests/loop_test2.f +++ b/tests/loop_test2.f @@ -6,6 +6,8 @@ subroutine f() integer nq, m real wrk5, v + integer l1,j,l2 + integer indx DO 140 L1 = 1,NQ DO 110 J = 1,M WRK5(J) = V(INDX,J,L1) diff --git a/tests/parameter1.f90 b/tests/parameter1.f90 new file mode 100644 index 0000000000..f4ea22ef7f --- /dev/null +++ b/tests/parameter1.f90 @@ -0,0 +1,5 @@ +subroutine 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 diff --git a/tests/reference/asr-allocate_01-f3446f6.json b/tests/reference/asr-allocate_01-f3446f6.json index a44d0d6163..8d5a3462a3 100644 --- a/tests/reference/asr-allocate_01-f3446f6.json +++ b/tests/reference/asr-allocate_01-f3446f6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_01-f3446f6.stdout", - "stdout_hash": "fced1a1ffe97552fc3d6e6e2886ba48964557815900516ec1115ca73", + "stdout_hash": "c5831d361c04d023226b86f85ad720fb533fe24e15c0e5b1ef25aea7", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-allocate_01-f3446f6.stdout b/tests/reference/asr-allocate_01-f3446f6.stdout index 97cf257011..cbc6296e42 100644 --- a/tests/reference/asr-allocate_01-f3446f6.stdout +++ b/tests/reference/asr-allocate_01-f3446f6.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Complex 4 []) Source Public Required .false.), reduce_sum: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Complex 4 []) Source Public Required .false.)}) reduce_sum [(Var 4 c)] [] [(= (Var 4 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToComplex (Complex 4 []) ()) ()) (DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 r) (ComplexBinOp (Var 4 r) Add (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Complex 4 []) ()) (Complex 4 []) ()) ())])])])] (Var 4 r) Source Public Implementation () .false. .false. .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b In () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Out () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c_copy: (Variable 3 c_copy Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.)}) sum [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(Allocate [(3 c_copy [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(3 c [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (DoLoop ((Var 3 i) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 j) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 k) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 3 c_copy) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ()) (= (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ())])])]) (ExplicitDeallocate [3 c_copy]) (ImplicitDeallocate [3 c_copy])] () Source Public Implementation () .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 5 (Integer 4 [])) (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(2 b [((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] (Var 2 ierr) () ()) (If (IntegerCompare (ArraySize (Var 2 a) () (Integer 4 []) ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (ArraySize (Var 2 b) () (Integer 4 []) ()) NotEq (IntegerBinOp (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Mul (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ())])]) (ImplicitDeallocate [2 c]) (SubroutineCall 2 sum () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] ()) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (IntegerCompare (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) NotEq (Var 2 i) (Logical 4 []) ()) [(ErrorStop ())] [])]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) 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 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 k) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (ComplexCompare (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Complex 4 []) ()) 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 ())] [])])])]) (= (Var 2 r) (FunctionCall 2 reduce_sum () [((Var 2 c))] (Complex 4 []) () ()) ()) (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 ())] []) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) +(TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Complex 4 []) Source Public Required .false.), reduce_sum: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Complex 4 []) Source Public Required .false.)}) reduce_sum [(Var 4 c)] [] [(= (Var 4 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToComplex (Complex 4 []) ()) ()) (DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 r) (ComplexBinOp (Var 4 r) Add (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Complex 4 []) ()) (Complex 4 []) ()) ())])])])] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b In () () Allocatable (Real 4 [(() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Out () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c_copy: (Variable 3 c_copy Local () () Allocatable (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.)}) sum [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(Allocate [(3 c_copy [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(3 c [((ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (IntegerBinOp (IntegerBinOp (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) Sub (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (DoLoop ((Var 3 i) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 j) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 k) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 3 c_copy) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ()) (= (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) (Cast (RealBinOp (Cast (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (ArrayItem (Var 3 b) [(() (Var 3 j) ()) (() (Var 3 k) ())] (Real 4 []) ()) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) ())])])]) (ExplicitDeallocate [3 c_copy]) (ImplicitDeallocate [3 c_copy])] () Source Public Implementation () .false. .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 5 (Integer 4 [])) (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] () () ()) (Allocate [(2 b [((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ())) ((Var 2 n) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Sub (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()))])] (Var 2 ierr) () ()) (If (IntegerCompare (ArraySize (Var 2 a) () (Integer 4 []) ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (ArraySize (Var 2 b) () (Integer 4 []) ()) NotEq (IntegerBinOp (IntegerBinOp (Var 2 n) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Mul (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) (Cast (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ())])]) (ImplicitDeallocate [2 c]) (SubroutineCall 2 sum () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] ()) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (IntegerConstant 5 (Integer 4 [])) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (Var 2 n) Add (IntegerConstant 5 (Integer 4 [])) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (If (LogicalBinOp (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) NotEq (Var 2 n) (Logical 4 []) ()) Or (IntegerCompare (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) NotEq (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 2 n) (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] []) (DoLoop ((Var 2 i) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 a) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (IntegerCompare (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Integer 4 []) ()) NotEq (Var 2 i) (Logical 4 []) ()) [(ErrorStop ())] [])]) (DoLoop ((Var 2 i) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 b) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ())] (Real 4 []) ()) 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 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 j) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 2 k) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 2 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (ComplexCompare (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Complex 4 []) ()) 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 ())] [])])])]) (= (Var 2 r) (FunctionCall 2 reduce_sum () [((Var 2 c))] (Complex 4 []) () ()) ()) (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 ())] []) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) diff --git a/tests/reference/asr-allocate_02-3c0d7c8.json b/tests/reference/asr-allocate_02-3c0d7c8.json index 1ef486ea8d..8103437268 100644 --- a/tests/reference/asr-allocate_02-3c0d7c8.json +++ b/tests/reference/asr-allocate_02-3c0d7c8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_02-3c0d7c8.stdout", - "stdout_hash": "44e573887cff00033271c0288438d6018607ba1a91f4159800b7ae5b", + "stdout_hash": "511c6596dbebbeb8b4f005c0a2ed4389bc2e8682c669bd8ee64c4ca4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-allocate_02-3c0d7c8.stdout b/tests/reference/asr-allocate_02-3c0d7c8.stdout index e1a99eacf5..08c0b6ff6e 100644 --- a/tests/reference/asr-allocate_02-3c0d7c8.stdout +++ b/tests/reference/asr-allocate_02-3c0d7c8.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), isource: (Variable 2 isource Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), whole_square: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), a_2: (Variable 3 a_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ab: (Variable 3 ab Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), abc: (Variable 3 abc Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b_2: (Variable 3 b_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), bc: (Variable 3 bc Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c: (Variable 3 c Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c_2: (Variable 3 c_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ca: (Variable 3 ca Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), n: (Variable 3 n Local () () Default (Integer 4 []) Source Public Required .false.), status: (Variable 3 status ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) whole_square [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(= (Var 3 n) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) (Allocate [(3 a_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 b_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 c_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))])] () () ()) (Allocate [(3 ab [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 bc [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 ca [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 abc [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))])] () () ()) (= (Var 3 status) (IntegerConstant 0 (Integer 4 [])) ()) (= (Var 3 a_2) (IntegerBinOp (Var 3 a) Mul (Var 3 a) (Integer 4 [(() ())]) ()) ()) (= (Var 3 b_2) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4 [(() ())]) ()) ()) (= (Var 3 c_2) (IntegerBinOp (Var 3 c) Mul (Var 3 c) (Integer 4 [(() ())]) ()) ()) (= (Var 3 ab) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 a) (Integer 4 []) ()) Mul (Var 3 b) (Integer 4 []) ()) ()) (= (Var 3 bc) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 b) (Integer 4 []) ()) Mul (Var 3 c) (Integer 4 []) ()) ()) (= (Var 3 ca) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 c) (Integer 4 []) ()) Mul (Var 3 a) (Integer 4 []) ()) ()) (= (Var 3 abc) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 a) (Integer 4 []) ()) Mul (Var 3 b) (Integer 4 []) ()) Mul (Var 3 c) (Integer 4 []) ()) ()) (= (Var 3 status) (IntegerConstant 1 (Integer 4 [])) ()) (ImplicitDeallocate [3 a_2 3 ab 3 abc 3 b_2 3 bc 3 c_2 3 ca])] (Var 3 status) Source Public Implementation () .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) (2 b [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) (2 c [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))])] (Var 2 ierr) () (Var 2 isource)) (= (Var 2 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 c) (IntegerConstant 3 (Integer 4 [])) ()) (Print () [(FunctionCall 2 whole_square () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Integer 4 []) () ())] () ()) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) +(TranslationUnit (SymbolTable 1 {allocate_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ierr: (Variable 2 ierr Local () () Default (Integer 4 []) Source Public Required .false.), isource: (Variable 2 isource Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.), whole_square: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), a_2: (Variable 3 a_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ab: (Variable 3 ab Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), abc: (Variable 3 abc Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), b_2: (Variable 3 b_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), bc: (Variable 3 bc Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c: (Variable 3 c Unspecified () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), c_2: (Variable 3 c_2 Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), ca: (Variable 3 ca Local () () Allocatable (Integer 4 [(() ())]) Source Public Required .false.), n: (Variable 3 n Local () () Default (Integer 4 []) Source Public Required .false.), status: (Variable 3 status ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) whole_square [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(= (Var 3 n) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) (Allocate [(3 a_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 b_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 c_2 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))])] () () ()) (Allocate [(3 ab [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 bc [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 ca [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) (3 abc [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))])] () () ()) (= (Var 3 status) (IntegerConstant 0 (Integer 4 [])) ()) (= (Var 3 a_2) (IntegerBinOp (Var 3 a) Mul (Var 3 a) (Integer 4 [(() ())]) ()) ()) (= (Var 3 b_2) (IntegerBinOp (Var 3 b) Mul (Var 3 b) (Integer 4 [(() ())]) ()) ()) (= (Var 3 c_2) (IntegerBinOp (Var 3 c) Mul (Var 3 c) (Integer 4 [(() ())]) ()) ()) (= (Var 3 ab) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 a) (Integer 4 []) ()) Mul (Var 3 b) (Integer 4 []) ()) ()) (= (Var 3 bc) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 b) (Integer 4 []) ()) Mul (Var 3 c) (Integer 4 []) ()) ()) (= (Var 3 ca) (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 c) (Integer 4 []) ()) Mul (Var 3 a) (Integer 4 []) ()) ()) (= (Var 3 abc) (IntegerBinOp (IntegerBinOp (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 3 a) (Integer 4 []) ()) Mul (Var 3 b) (Integer 4 []) ()) Mul (Var 3 c) (Integer 4 []) ()) ()) (= (Var 3 status) (IntegerConstant 1 (Integer 4 [])) ()) (ImplicitDeallocate [3 a_2 3 ab 3 abc 3 b_2 3 bc 3 c_2 3 ca])] (Var 3 status) Source Public Implementation () .false. .false. .false. .false.)}) allocate_01 [] [(= (Var 2 n) (IntegerConstant 10 (Integer 4 [])) ()) (Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) (2 b [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) (2 c [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))])] (Var 2 ierr) () (Var 2 isource)) (= (Var 2 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 b) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 c) (IntegerConstant 3 (Integer 4 [])) ()) (Print () [(FunctionCall 2 whole_square () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Integer 4 []) () ())] () ()) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) diff --git a/tests/reference/asr-allocate_03-8219a72.json b/tests/reference/asr-allocate_03-8219a72.json index be5c519e9e..7080edc854 100644 --- a/tests/reference/asr-allocate_03-8219a72.json +++ b/tests/reference/asr-allocate_03-8219a72.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-allocate_03-8219a72.stdout", - "stdout_hash": "19900d88f80e0e5e756f7d8eafd392863b0d349c6749de42ef78fb79", + "stdout_hash": "58daca116baf023b8cdfd06994ce4241aac28d27c6825c27b3f6b0f8", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-allocate_03-8219a72.stdout b/tests/reference/asr-allocate_03-8219a72.stdout index 9dd5fcc505..01407563b2 100644 --- a/tests/reference/asr-allocate_03-8219a72.stdout +++ b/tests/reference/asr-allocate_03-8219a72.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {allocate_03: (Program (SymbolTable 2 {c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), f: (Function (SymbolTable 3 {c: (Variable 3 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) f [(Var 3 c)] [] [(Allocate [(3 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] () () ()) (= (ArrayItem (Var 3 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 99 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false.), g: (Function (SymbolTable 4 {r: (Variable 4 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Unspecified () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) g [(Var 4 x)] [] [(Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [4 x]) (SubroutineCall 2 f () [((Var 4 x))] ()) (Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ()) (= (Var 4 r) (IntegerConstant 0 (Integer 4 [])) ())] (Var 4 r) Source Public Implementation () .false. .false. .false.), h: (Function (SymbolTable 5 {c: (Variable 5 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) h [(Var 5 c)] [] [(Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [5 c]) (SubroutineCall 2 f () [((Var 5 c))] ()) (Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false.), r: (Variable 2 r Local () () Default (Integer 4 []) Source Public Required .false.), stat: (Variable 2 stat Local () () Default (Integer 4 []) Source Public Required .false.)}) allocate_03 [] [(= (Var 2 stat) (IntegerConstant 1 (Integer 4 [])) ()) (Allocate [(2 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] (Var 2 stat) () ()) (If (IntegerCompare (Var 2 stat) NotEq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 3 (Integer 4 [])) ()) (ImplicitDeallocate [2 c]) (SubroutineCall 2 h () [((Var 2 c))] ()) (= (Var 2 r) (FunctionCall 2 g () [((Var 2 c))] (Integer 4 []) () ()) ()) (Print () [(ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [2 c])])}) []) +(TranslationUnit (SymbolTable 1 {allocate_03: (Program (SymbolTable 2 {c: (Variable 2 c Local () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), f: (Function (SymbolTable 3 {c: (Variable 3 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) f [(Var 3 c)] [] [(Allocate [(3 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] () () ()) (= (ArrayItem (Var 3 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 99 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false. .false.), g: (Function (SymbolTable 4 {r: (Variable 4 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Unspecified () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) g [(Var 4 x)] [] [(Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [4 x]) (SubroutineCall 2 f () [((Var 4 x))] ()) (Print () [(ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 4 x) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ()) (= (Var 4 r) (IntegerConstant 0 (Integer 4 [])) ())] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), h: (Function (SymbolTable 5 {c: (Variable 5 c Out () () Allocatable (Integer 4 [(() ()) (() ()) (() ())]) Source Public Required .false.)}) h [(Var 5 c)] [] [(Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [5 c]) (SubroutineCall 2 f () [((Var 5 c))] ()) (Print () [(ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (= (ArrayItem (Var 5 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 8 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false. .false.), r: (Variable 2 r Local () () Default (Integer 4 []) Source Public Required .false.), stat: (Variable 2 stat Local () () Default (Integer 4 []) Source Public Required .false.)}) allocate_03 [] [(= (Var 2 stat) (IntegerConstant 1 (Integer 4 [])) ()) (Allocate [(2 c [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])] (Var 2 stat) () ()) (If (IntegerCompare (Var 2 stat) NotEq (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 3 (Integer 4 [])) ()) (ImplicitDeallocate [2 c]) (SubroutineCall 2 h () [((Var 2 c))] ()) (= (Var 2 r) (FunctionCall 2 g () [((Var 2 c))] (Integer 4 []) () ()) ()) (Print () [(ArrayItem (Var 2 c) [(() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ()) (() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ())] () ()) (ImplicitDeallocate [2 c])])}) []) diff --git a/tests/reference/asr-allow_implicit_interface-dfa7a9a.json b/tests/reference/asr-allow_implicit_interface-dfa7a9a.json new file mode 100644 index 0000000000..619233b9e0 --- /dev/null +++ b/tests/reference/asr-allow_implicit_interface-dfa7a9a.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-allow_implicit_interface-dfa7a9a", + "cmd": "lfortran --show-asr --allow-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-dfa7a9a.stdout", + "stdout_hash": "c78304a86d10f4c75cfc40b69d14a55328d9282c1a9449b3e1e17a86", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout b/tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout new file mode 100644 index 0000000000..c3c9510145 --- /dev/null +++ b/tests/reference/asr-allow_implicit_interface-dfa7a9a.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), prho: (Function (SymbolTable 2 {alnorm: (Function (SymbolTable 225 {alnorm_arg_0: (Variable 225 alnorm_arg_0 Unspecified () () Default (Real 8 []) Source Public Required .false.), alnorm_arg_1: (Variable 225 alnorm_arg_1 Unspecified () () Default (Logical 4 []) Source Public Required .false.), alnorm_return_var_name: (Variable 225 alnorm_return_var_name ReturnVar () () Default (Real 8 []) Source Public Required .false.)}) alnorm [(Var 225 alnorm_arg_0) (Var 225 alnorm_arg_1)] [] [] (Var 225 alnorm_return_var_name) Source Public Interface () .false. .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 8 []) Source Public Required .false.), dgetrf: (Function (SymbolTable 226 {dgetrf_arg_0: (Variable 226 dgetrf_arg_0 Unspecified () () Default (Real 8 []) Source Public Required .false.), dgetrf_arg_1: (Variable 226 dgetrf_arg_1 Unspecified () () Default (Real 8 []) Source Public Required .false.), dgetrf_arg_2: (Variable 226 dgetrf_arg_2 Unspecified () () Default (Real 8 []) Source Public Required .false.)}) dgetrf [(Var 226 dgetrf_arg_0) (Var 226 dgetrf_arg_1) (Var 226 dgetrf_arg_2)] [] [] () Source Public Interface () .false. .false. .false. .false.), exp: (ExternalSymbol 2 exp 4 exp lfortran_intrinsic_math [] exp Private), exp@dexp: (ExternalSymbol 2 exp@dexp 4 dexp lfortran_intrinsic_math [] dexp Private), one: (Variable 2 one Local () (RealConstant 1.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), prho: (Variable 2 prho ReturnVar () () Default (Real 8 []) Source Public Required .false.), six: (Variable 2 six Local () (RealConstant 6.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), two: (Variable 2 two Local () (RealConstant 2.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.), u: (Variable 2 u Local () () Default (Real 8 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 8 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 8 []) Source Public Required .false.), zero: (Variable 2 zero Local () (RealConstant 0.000000 (Real 8 [])) Default (Real 8 []) Source Public Required .false.)}) prho [] [] [(= (Var 2 prho) (RealBinOp (RealBinOp (Var 2 u) Div (FunctionCall 2 exp@dexp 2 exp [((RealBinOp (Var 2 y) Div (Var 2 two) (Real 8 []) ()))] (Real 8 []) () ()) (Real 8 []) ()) Add (FunctionCall 2 alnorm () [((Var 2 x)) ((LogicalConstant .true. (Logical 4 [])))] (Real 8 []) () ()) (Real 8 []) ()) ()) (SubroutineCall 2 dgetrf () [((Var 2 x)) ((Var 2 y)) ((Var 2 u))] ()) (If (RealCompare (Var 2 prho) Lt (Var 2 zero) (Logical 4 []) ()) [(= (Var 2 prho) (Var 2 zero) ())] []) (If (RealCompare (Var 2 prho) Gt (Var 2 one) (Logical 4 []) ()) [(= (Var 2 prho) (Var 2 one) ())] []) (Return)] (Var 2 prho) Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-arrays_03_func-7c8d572.json b/tests/reference/asr-arrays_03_func-7c8d572.json index 4ba8ef320f..44fd636517 100644 --- a/tests/reference/asr-arrays_03_func-7c8d572.json +++ b/tests/reference/asr-arrays_03_func-7c8d572.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_03_func-7c8d572.stdout", - "stdout_hash": "392235bdb644223c34c0c4e780c3be78c415f48328980a0e1c458b9e", + "stdout_hash": "52712b4a0722f0b4881b9cecaa0654c89e73836a0d0669dde27f6107", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_03_func-7c8d572.stdout b/tests/reference/asr-arrays_03_func-7c8d572.stdout index 3c09c5a0af..a1837d3cf9 100644 --- a/tests/reference/asr-arrays_03_func-7c8d572.stdout +++ b/tests/reference/asr-arrays_03_func-7c8d572.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {arrays_03_func: (Program (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), mysum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) mysum [(Var 3 a)] [] [(= (Var 3 r) (IntegerConstant 0 (Integer 4 [])) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (Var 3 r) (IntegerBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) (Integer 4 []) ()) ())])] (Var 3 r) Source Public Implementation () .false. .false. .false.), s: (Variable 2 s Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.)}) arrays_03_func [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 2 x) () (Integer 4 []) (IntegerConstant 10 (Integer 4 []))) ()) [(= (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 s) (FunctionCall 2 mysum () [((Var 2 x))] (Integer 4 []) () ()) ()) (Print () [(Var 2 s)] () ()) (If (IntegerCompare (Var 2 s) NotEq (IntegerConstant 55 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) +(TranslationUnit (SymbolTable 1 {arrays_03_func: (Program (SymbolTable 2 {i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), mysum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) mysum [(Var 3 a)] [] [(= (Var 3 r) (IntegerConstant 0 (Integer 4 [])) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (Var 3 r) (IntegerBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) (Integer 4 []) ()) ())])] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.), s: (Variable 2 s Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.)}) arrays_03_func [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 2 x) () (Integer 4 []) (IntegerConstant 10 (Integer 4 []))) ()) [(= (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 s) (FunctionCall 2 mysum () [((Var 2 x))] (Integer 4 []) () ()) ()) (Print () [(Var 2 s)] () ()) (If (IntegerCompare (Var 2 s) NotEq (IntegerConstant 55 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) diff --git a/tests/reference/asr-arrays_04_func-9f59ad6.json b/tests/reference/asr-arrays_04_func-9f59ad6.json index 9002a6514b..21ac5e7cb4 100644 --- a/tests/reference/asr-arrays_04_func-9f59ad6.json +++ b/tests/reference/asr-arrays_04_func-9f59ad6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_04_func-9f59ad6.stdout", - "stdout_hash": "2e8194a7e05c954985951b0d7e2abbb49ab3e386490403e2b082c098", + "stdout_hash": "0826ce9a245416260bf810b8c986c70849bc9d7a5b0f873bf7b1ce79", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_04_func-9f59ad6.stdout b/tests/reference/asr-arrays_04_func-9f59ad6.stdout index 8b7b102961..13a48604df 100644 --- a/tests/reference/asr-arrays_04_func-9f59ad6.stdout +++ b/tests/reference/asr-arrays_04_func-9f59ad6.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {arrays_04_func: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), abs: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) abs [(Var 4 a)] [] [(Print () [(StringConstant "abs" (Character 1 3 () []))] () ()) (If (RealCompare (Var 4 a) Gt (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) (Logical 4 []) ()) [(= (Var 4 r) (Var 4 a) ())] [(= (Var 4 r) (RealUnaryMinus (Var 4 a) (Real 4 []) ()) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) sum [(Var 3 a)] [] [(Print () [(StringConstant "sum" (Character 1 3 () []))] () ()) (= (Var 3 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (Var 3 r) (RealBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4 []) ()) (Real 4 []) ()) ())])] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) arrays_04_func [] [(= (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) ()) (= (Var 2 b) (FunctionCall 2 sum () [((Var 2 a))] (Real 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs () [((RealBinOp (Var 2 b) Sub (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) +(TranslationUnit (SymbolTable 1 {arrays_04_func: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), abs: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) abs [(Var 4 a)] [] [(Print () [(StringConstant "abs" (Character 1 3 () []))] () ()) (If (RealCompare (Var 4 a) Gt (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) (Logical 4 []) ()) [(= (Var 4 r) (Var 4 a) ())] [(= (Var 4 r) (RealUnaryMinus (Var 4 a) (Real 4 []) ()) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), sum: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) sum [(Var 3 a)] [] [(Print () [(StringConstant "sum" (Character 1 3 () []))] () ()) (= (Var 3 r) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (Var 3 r) (RealBinOp (Var 3 r) Add (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4 []) ()) (Real 4 []) ()) ())])] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.)}) arrays_04_func [] [(= (ArrayItem (Var 2 a) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 a) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 a) [(() (IntegerConstant 3 (Integer 4 [])) ())] (Real 4 []) ()) (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) ()) (= (Var 2 b) (FunctionCall 2 sum () [((Var 2 a))] (Real 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs () [((RealBinOp (Var 2 b) Sub (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) diff --git a/tests/reference/asr-arrays_08_func-2759ced.json b/tests/reference/asr-arrays_08_func-2759ced.json index dcb23f27f3..1c392a14c6 100644 --- a/tests/reference/asr-arrays_08_func-2759ced.json +++ b/tests/reference/asr-arrays_08_func-2759ced.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_08_func-2759ced.stdout", - "stdout_hash": "d7ea665bf0a31ee67d11cd05584d8b2901d626dc04bb891d230b7413", + "stdout_hash": "2d5aeaa77043edea9166e2c5b2e4cc787db66b4678c54665a16844ce", "stderr": "asr-arrays_08_func-2759ced.stderr", "stderr_hash": "d70481e5625f20fa12d3e8bdad4a5dfa6912ac62ade8fc840a5da64b", "returncode": 0 diff --git a/tests/reference/asr-arrays_08_func-2759ced.stdout b/tests/reference/asr-arrays_08_func-2759ced.stdout index 804edd2eab..9b1204b73f 100644 --- a/tests/reference/asr-arrays_08_func-2759ced.stdout +++ b/tests/reference/asr-arrays_08_func-2759ced.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {arrays_08_func: (Program (SymbolTable 2 {copy_from_to: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Out () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.)}) copy_from_to [(Var 3 a) (Var 3 b)] [] [(DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Integer 4 []) ()) (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) ())])] () Source Public Implementation () .false. .false. .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Logical 4 []) Source Public Required .false.), verify: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 4 b In () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) verify [(Var 4 a) (Var 4 b)] [] [(= (Var 4 r) (LogicalConstant .true. (Logical 4 [])) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 4 a) () (Integer 4 []) ()) ()) [(= (Var 4 r) (LogicalBinOp (Var 4 r) And (IntegerCompare (ArrayItem (Var 4 a) [(() (Var 4 i) ())] (Integer 4 []) ()) Eq (ArrayItem (Var 4 b) [(() (Var 4 i) ())] (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.)}) arrays_08_func [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 2 x) () (Integer 4 []) (IntegerConstant 10 (Integer 4 []))) ()) [(= (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (SubroutineCall 2 copy_from_to () [((Var 2 x)) ((Var 2 y))] ()) (= (Var 2 r) (FunctionCall 2 verify () [((Var 2 x)) ((Var 2 y))] (Logical 4 []) () ()) ()) (Print () [(Var 2 r)] () ()) (If (LogicalNot (Var 2 r) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) +(TranslationUnit (SymbolTable 1 {arrays_08_func: (Program (SymbolTable 2 {copy_from_to: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Out () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.)}) copy_from_to [(Var 3 a) (Var 3 b)] [] [(DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) [(= (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Integer 4 []) ()) (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Integer 4 []) ()) ())])] () Source Public Implementation () .false. .false. .false. .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Local () () Default (Logical 4 []) Source Public Required .false.), verify: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 4 b In () () Default (Integer 4 [(() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) verify [(Var 4 a) (Var 4 b)] [] [(= (Var 4 r) (LogicalConstant .true. (Logical 4 [])) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 4 a) () (Integer 4 []) ()) ()) [(= (Var 4 r) (LogicalBinOp (Var 4 r) And (IntegerCompare (ArrayItem (Var 4 a) [(() (Var 4 i) ())] (Integer 4 []) ()) Eq (ArrayItem (Var 4 b) [(() (Var 4 i) ())] (Integer 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.)}) arrays_08_func [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (ArraySize (Var 2 x) () (Integer 4 []) (IntegerConstant 10 (Integer 4 []))) ()) [(= (ArrayItem (Var 2 x) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (SubroutineCall 2 copy_from_to () [((Var 2 x)) ((Var 2 y))] ()) (= (Var 2 r) (FunctionCall 2 verify () [((Var 2 x)) ((Var 2 y))] (Logical 4 []) () ()) ()) (Print () [(Var 2 r)] () ()) (If (LogicalNot (Var 2 r) (Logical 4 []) ()) [(ErrorStop ())] [])])}) []) diff --git a/tests/reference/asr-arrays_elemental_15-c7c15ca.json b/tests/reference/asr-arrays_elemental_15-c7c15ca.json index 3e8a345a43..f9e88d2fa9 100644 --- a/tests/reference/asr-arrays_elemental_15-c7c15ca.json +++ b/tests/reference/asr-arrays_elemental_15-c7c15ca.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_elemental_15-c7c15ca.stdout", - "stdout_hash": "692236d55bddf7d9865128ac96a29e9fb9a93723a81f5428260d4f2e", + "stdout_hash": "d3eba375be8ef8dabb8022e0763d7128f5589a95f6c0e1d2875d9814", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_elemental_15-c7c15ca.stdout b/tests/reference/asr-arrays_elemental_15-c7c15ca.stdout index 7d069b81fa..031d211e7c 100644 --- a/tests/reference/asr-arrays_elemental_15-c7c15ca.stdout +++ b/tests/reference/asr-arrays_elemental_15-c7c15ca.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {arrays_elemental_15: (Program (SymbolTable 2 {elemental_cos: (Function (SymbolTable 7 {array2d: (Variable 7 array2d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) Source Public Required .false.), cos: (ExternalSymbol 7 cos 10 cos lfortran_intrinsic_math [] cos Private), cos2d: (Variable 7 cos2d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) Source Public Required .false.), cos@dcos: (ExternalSymbol 7 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), i: (Variable 7 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 7 j Local () () Default (Integer 4 []) Source Public Required .false.)}) elemental_cos [] [] [(DoLoop ((Var 7 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(DoLoop ((Var 7 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(= (ArrayItem (Var 7 array2d) [(() (Var 7 i) ()) (() (Var 7 j) ())] (Real 8 []) ()) (Cast (IntegerBinOp (Var 7 i) Add (Var 7 j) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])]) (= (Var 7 cos2d) (RealBinOp (FunctionCall 7 cos@dcos 7 cos [((Var 7 array2d))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) ()) ()) (SubroutineCall 2 verify2d () [((Var 7 array2d)) ((Var 7 cos2d)) ((IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 64 (Integer 4 [])))] ())] () Source Public Implementation () .false. .false. .false.), elemental_sin: (Function (SymbolTable 6 {array1d: (Variable 6 array1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), arraynd: (Variable 6 arraynd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 6 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 6 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 6 k Local () () Default (Integer 4 []) Source Public Required .false.), sin: (ExternalSymbol 6 sin 10 sin lfortran_intrinsic_math [] sin Private), sin1d: (Variable 6 sin1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), sin@dsin: (ExternalSymbol 6 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), sinnd: (Variable 6 sinnd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.)}) elemental_sin [] [] [(DoLoop ((Var 6 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (ArrayItem (Var 6 array1d) [(() (Var 6 i) ())] (Real 8 []) ()) (Cast (Var 6 i) IntegerToReal (Real 8 []) ()) ())]) (= (Var 6 sin1d) (FunctionCall 6 sin@dsin 6 sin [((FunctionCall 6 sin@dsin 6 sin [((Var 6 array1d))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) () ()))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) () ()) ()) (SubroutineCall 2 verify1d () [((Var 6 array1d)) ((Var 6 sin1d)) ((IntegerConstant 256 (Integer 4 [])))] ()) (DoLoop ((Var 6 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(DoLoop ((Var 6 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(DoLoop ((Var 6 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 6 arraynd) [(() (Var 6 i) ()) (() (Var 6 j) ()) (() (Var 6 k) ())] (Real 8 []) ()) (Cast (IntegerBinOp (IntegerBinOp (Var 6 i) Add (Var 6 j) (Integer 4 []) ()) Add (Var 6 k) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])])]) (= (Var 6 sinnd) (RealBinOp (FunctionCall 6 sin@dsin 6 sin [((Var 6 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) ()) ()) (SubroutineCall 2 verifynd () [((Var 6 arraynd)) ((Var 6 sinnd)) ((IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 16 (Integer 4 [])))] ())] () Source Public Implementation () .false. .false. .false.), elemental_trig_identity: (Function (SymbolTable 8 {abs: (ExternalSymbol 8 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 8 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), arraynd: (Variable 8 arraynd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), cos: (ExternalSymbol 8 cos 10 cos lfortran_intrinsic_math [] cos Private), cos@dcos: (ExternalSymbol 8 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), eps: (Variable 8 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 8 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 8 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 8 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 8 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 8 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), observed: (Variable 8 observed Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), observed1d: (Variable 8 observed1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 65536 (Integer 4 [])))]) Source Public Required .false.), sin: (ExternalSymbol 8 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 8 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private)}) elemental_trig_identity [] [] [(= (Var 8 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 8 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(DoLoop ((Var 8 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 [])) ()) [(DoLoop ((Var 8 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 [])) ()) [(DoLoop ((Var 8 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (ArrayItem (Var 8 arraynd) [(() (Var 8 i) ()) (() (Var 8 j) ()) (() (Var 8 k) ()) (() (Var 8 l) ())] (Real 8 []) ()) (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 8 i) Add (Var 8 j) (Integer 4 []) ()) Add (Var 8 k) (Integer 4 []) ()) Add (Var 8 l) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])])])]) (= (Var 8 observed) (RealBinOp (RealBinOp (FunctionCall 8 sin@dsin 8 sin [((Var 8 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) Add (RealBinOp (FunctionCall 8 cos@dcos 8 cos [((Var 8 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) ()) (= (ArrayItem (Var 8 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 65536 (Integer 4 [])) ()) (= (Var 8 observed1d) (ArrayReshape (Var 8 observed) (Var 8 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 8 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 65536 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 8 abs@dabs 8 abs [((RealBinOp (ArrayItem (Var 8 observed1d) [(() (Var 8 i) ())] (Real 8 []) ()) Sub (Cast (RealConstant 1.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 1.000000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 8 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false.), verify1d: (Function (SymbolTable 3 {abs: (ExternalSymbol 3 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 3 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 3 array In () () Default (Real 8 [(() ())]) Source Public Required .false.), eps: (Variable 3 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 3 result In () () Default (Real 8 [(() ())]) Source Public Required .false.), sin: (ExternalSymbol 3 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 3 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), size: (Variable 3 size In () () Default (Integer 4 []) Source Public Required .false.)}) verify1d [(Var 3 array) (Var 3 result) (Var 3 size)] [] [(= (Var 3 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (Var 3 size) ()) [(If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (FunctionCall 3 sin@dsin 3 sin [((FunctionCall 3 sin@dsin 3 sin [((ArrayItem (Var 3 array) [(() (Var 3 i) ())] (Real 8 []) ()))] (Real 8 []) () ()))] (Real 8 []) () ()) Sub (ArrayItem (Var 3 result) [(() (Var 3 i) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false.), verify2d: (Function (SymbolTable 5 {abs: (ExternalSymbol 5 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 5 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 5 array In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), cos: (ExternalSymbol 5 cos 10 cos lfortran_intrinsic_math [] cos Private), cos@dcos: (ExternalSymbol 5 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), eps: (Variable 5 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 5 j Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 5 result In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), size1: (Variable 5 size1 In () () Default (Integer 4 []) Source Public Required .false.), size2: (Variable 5 size2 In () () Default (Integer 4 []) Source Public Required .false.)}) verify2d [(Var 5 array) (Var 5 result) (Var 5 size1) (Var 5 size2)] [] [(= (Var 5 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 5 i) (IntegerConstant 1 (Integer 4 [])) (Var 5 size1) ()) [(DoLoop ((Var 5 j) (IntegerConstant 1 (Integer 4 [])) (Var 5 size2) ()) [(If (RealCompare (FunctionCall 5 abs@dabs 5 abs [((RealBinOp (RealBinOp (FunctionCall 5 cos@dcos 5 cos [((ArrayItem (Var 5 array) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()))] (Real 8 []) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 2.000000 (Real 8 []))) (Real 8 []) ()) Sub (ArrayItem (Var 5 result) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 5 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])] () Source Public Implementation () .false. .false. .false.), verifynd: (Function (SymbolTable 4 {abs: (ExternalSymbol 4 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 4 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 4 array In () () Default (Real 8 [(() ()) (() ()) (() ())]) Source Public Required .false.), eps: (Variable 4 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 4 result In () () Default (Real 8 [(() ()) (() ()) (() ())]) Source Public Required .false.), sin: (ExternalSymbol 4 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 4 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), size1: (Variable 4 size1 In () () Default (Integer 4 []) Source Public Required .false.), size2: (Variable 4 size2 In () () Default (Integer 4 []) Source Public Required .false.), size3: (Variable 4 size3 In () () Default (Integer 4 []) Source Public Required .false.)}) verifynd [(Var 4 array) (Var 4 result) (Var 4 size1) (Var 4 size2) (Var 4 size3)] [] [(= (Var 4 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (Var 4 size1) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (Var 4 size2) ()) [(DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (Var 4 size3) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (FunctionCall 4 sin@dsin 4 sin [((ArrayItem (Var 4 array) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()))] (Real 8 []) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 2.000000 (Real 8 []))) (Real 8 []) ()) Sub (ArrayItem (Var 4 result) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false.)}) arrays_elemental_15 [] [(SubroutineCall 2 elemental_sin () [] ()) (SubroutineCall 2 elemental_cos () [] ()) (SubroutineCall 2 elemental_trig_identity () [] ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) +(TranslationUnit (SymbolTable 1 {arrays_elemental_15: (Program (SymbolTable 2 {elemental_cos: (Function (SymbolTable 7 {array2d: (Variable 7 array2d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) Source Public Required .false.), cos: (ExternalSymbol 7 cos 10 cos lfortran_intrinsic_math [] cos Private), cos2d: (Variable 7 cos2d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) Source Public Required .false.), cos@dcos: (ExternalSymbol 7 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), i: (Variable 7 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 7 j Local () () Default (Integer 4 []) Source Public Required .false.)}) elemental_cos [] [] [(DoLoop ((Var 7 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(DoLoop ((Var 7 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(= (ArrayItem (Var 7 array2d) [(() (Var 7 i) ()) (() (Var 7 j) ())] (Real 8 []) ()) (Cast (IntegerBinOp (Var 7 i) Add (Var 7 j) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])]) (= (Var 7 cos2d) (RealBinOp (FunctionCall 7 cos@dcos 7 cos [((Var 7 array2d))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])))]) ()) ()) (SubroutineCall 2 verify2d () [((Var 7 array2d)) ((Var 7 cos2d)) ((IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 64 (Integer 4 [])))] ())] () Source Public Implementation () .false. .false. .false. .false.), elemental_sin: (Function (SymbolTable 6 {array1d: (Variable 6 array1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), arraynd: (Variable 6 arraynd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 6 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 6 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 6 k Local () () Default (Integer 4 []) Source Public Required .false.), sin: (ExternalSymbol 6 sin 10 sin lfortran_intrinsic_math [] sin Private), sin1d: (Variable 6 sin1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), sin@dsin: (ExternalSymbol 6 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), sinnd: (Variable 6 sinnd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.)}) elemental_sin [] [] [(DoLoop ((Var 6 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (ArrayItem (Var 6 array1d) [(() (Var 6 i) ())] (Real 8 []) ()) (Cast (Var 6 i) IntegerToReal (Real 8 []) ()) ())]) (= (Var 6 sin1d) (FunctionCall 6 sin@dsin 6 sin [((FunctionCall 6 sin@dsin 6 sin [((Var 6 array1d))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) () ()))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) () ()) ()) (SubroutineCall 2 verify1d () [((Var 6 array1d)) ((Var 6 sin1d)) ((IntegerConstant 256 (Integer 4 [])))] ()) (DoLoop ((Var 6 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(DoLoop ((Var 6 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(DoLoop ((Var 6 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 6 arraynd) [(() (Var 6 i) ()) (() (Var 6 j) ()) (() (Var 6 k) ())] (Real 8 []) ()) (Cast (IntegerBinOp (IntegerBinOp (Var 6 i) Add (Var 6 j) (Integer 4 []) ()) Add (Var 6 k) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])])]) (= (Var 6 sinnd) (RealBinOp (FunctionCall 6 sin@dsin 6 sin [((Var 6 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) ()) ()) (SubroutineCall 2 verifynd () [((Var 6 arraynd)) ((Var 6 sinnd)) ((IntegerConstant 256 (Integer 4 []))) ((IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 16 (Integer 4 [])))] ())] () Source Public Implementation () .false. .false. .false. .false.), elemental_trig_identity: (Function (SymbolTable 8 {abs: (ExternalSymbol 8 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 8 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), arraynd: (Variable 8 arraynd Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), cos: (ExternalSymbol 8 cos 10 cos lfortran_intrinsic_math [] cos Private), cos@dcos: (ExternalSymbol 8 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), eps: (Variable 8 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 8 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 8 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 8 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 8 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 8 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), observed: (Variable 8 observed Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), observed1d: (Variable 8 observed1d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 65536 (Integer 4 [])))]) Source Public Required .false.), sin: (ExternalSymbol 8 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 8 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private)}) elemental_trig_identity [] [] [(= (Var 8 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 8 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 [])) ()) [(DoLoop ((Var 8 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 [])) ()) [(DoLoop ((Var 8 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 [])) ()) [(DoLoop ((Var 8 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (ArrayItem (Var 8 arraynd) [(() (Var 8 i) ()) (() (Var 8 j) ()) (() (Var 8 k) ()) (() (Var 8 l) ())] (Real 8 []) ()) (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 8 i) Add (Var 8 j) (Integer 4 []) ()) Add (Var 8 k) (Integer 4 []) ()) Add (Var 8 l) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) ())])])])]) (= (Var 8 observed) (RealBinOp (RealBinOp (FunctionCall 8 sin@dsin 8 sin [((Var 8 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) Add (RealBinOp (FunctionCall 8 cos@dcos 8 cos [((Var 8 arraynd))] (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) (RealConstant 2.000000 (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]))) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 64 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 32 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 8 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) ()) ()) (= (ArrayItem (Var 8 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 65536 (Integer 4 [])) ()) (= (Var 8 observed1d) (ArrayReshape (Var 8 observed) (Var 8 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 8 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 65536 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 8 abs@dabs 8 abs [((RealBinOp (ArrayItem (Var 8 observed1d) [(() (Var 8 i) ())] (Real 8 []) ()) Sub (Cast (RealConstant 1.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 1.000000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 8 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false. .false.), verify1d: (Function (SymbolTable 3 {abs: (ExternalSymbol 3 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 3 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 3 array In () () Default (Real 8 [(() ())]) Source Public Required .false.), eps: (Variable 3 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 3 result In () () Default (Real 8 [(() ())]) Source Public Required .false.), sin: (ExternalSymbol 3 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 3 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), size: (Variable 3 size In () () Default (Integer 4 []) Source Public Required .false.)}) verify1d [(Var 3 array) (Var 3 result) (Var 3 size)] [] [(= (Var 3 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (Var 3 size) ()) [(If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (FunctionCall 3 sin@dsin 3 sin [((FunctionCall 3 sin@dsin 3 sin [((ArrayItem (Var 3 array) [(() (Var 3 i) ())] (Real 8 []) ()))] (Real 8 []) () ()))] (Real 8 []) () ()) Sub (ArrayItem (Var 3 result) [(() (Var 3 i) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false. .false.), verify2d: (Function (SymbolTable 5 {abs: (ExternalSymbol 5 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 5 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 5 array In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), cos: (ExternalSymbol 5 cos 10 cos lfortran_intrinsic_math [] cos Private), cos@dcos: (ExternalSymbol 5 cos@dcos 10 dcos lfortran_intrinsic_math [] dcos Private), eps: (Variable 5 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 5 j Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 5 result In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), size1: (Variable 5 size1 In () () Default (Integer 4 []) Source Public Required .false.), size2: (Variable 5 size2 In () () Default (Integer 4 []) Source Public Required .false.)}) verify2d [(Var 5 array) (Var 5 result) (Var 5 size1) (Var 5 size2)] [] [(= (Var 5 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 5 i) (IntegerConstant 1 (Integer 4 [])) (Var 5 size1) ()) [(DoLoop ((Var 5 j) (IntegerConstant 1 (Integer 4 [])) (Var 5 size2) ()) [(If (RealCompare (FunctionCall 5 abs@dabs 5 abs [((RealBinOp (RealBinOp (FunctionCall 5 cos@dcos 5 cos [((ArrayItem (Var 5 array) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()))] (Real 8 []) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 2.000000 (Real 8 []))) (Real 8 []) ()) Sub (ArrayItem (Var 5 result) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 5 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])] () Source Public Implementation () .false. .false. .false. .false.), verifynd: (Function (SymbolTable 4 {abs: (ExternalSymbol 4 abs 10 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 4 abs@dabs 10 dabs lfortran_intrinsic_math [] dabs Private), array: (Variable 4 array In () () Default (Real 8 [(() ()) (() ()) (() ())]) Source Public Required .false.), eps: (Variable 4 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), result: (Variable 4 result In () () Default (Real 8 [(() ()) (() ()) (() ())]) Source Public Required .false.), sin: (ExternalSymbol 4 sin 10 sin lfortran_intrinsic_math [] sin Private), sin@dsin: (ExternalSymbol 4 sin@dsin 10 dsin lfortran_intrinsic_math [] dsin Private), size1: (Variable 4 size1 In () () Default (Integer 4 []) Source Public Required .false.), size2: (Variable 4 size2 In () () Default (Integer 4 []) Source Public Required .false.), size3: (Variable 4 size3 In () () Default (Integer 4 []) Source Public Required .false.)}) verifynd [(Var 4 array) (Var 4 result) (Var 4 size1) (Var 4 size2) (Var 4 size3)] [] [(= (Var 4 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (Var 4 size1) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (Var 4 size2) ()) [(DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (Var 4 size3) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (FunctionCall 4 sin@dsin 4 sin [((ArrayItem (Var 4 array) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()))] (Real 8 []) () ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 8 []) (RealConstant 2.000000 (Real 8 []))) (Real 8 []) ()) Sub (ArrayItem (Var 4 result) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false. .false.)}) arrays_elemental_15 [] [(SubroutineCall 2 elemental_sin () [] ()) (SubroutineCall 2 elemental_cos () [] ()) (SubroutineCall 2 elemental_trig_identity () [] ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) diff --git a/tests/reference/asr-arrays_op_4-ca3318f.json b/tests/reference/asr-arrays_op_4-ca3318f.json index 173467b7ab..1cd0bc299e 100644 --- a/tests/reference/asr-arrays_op_4-ca3318f.json +++ b/tests/reference/asr-arrays_op_4-ca3318f.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_4-ca3318f.stdout", - "stdout_hash": "082370c90dfe0b3abde5a219798bd2156881a3d4cd6d3617198b8d99", + "stdout_hash": "e70a60c89ace8402ea7095499e77b8f438050ff69003ffd2e0ec2761", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_op_4-ca3318f.stdout b/tests/reference/asr-arrays_op_4-ca3318f.stdout index e77a5d6c9e..51de9bc0dd 100644 --- a/tests/reference/asr-arrays_op_4-ca3318f.stdout +++ b/tests/reference/asr-arrays_op_4-ca3318f.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {array_op_3: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), dim1: (Variable 2 dim1 Local (IntegerConstant 10 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), dim2: (Variable 2 dim2 Local (IntegerConstant 100 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), dim3: (Variable 2 dim3 Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), modulo2: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) modulo2 [(Var 3 x)] [] [(= (Var 3 r) (IntegerCompare (IntegerBinOp (Var 3 x) Sub (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (IntegerBinOp (Var 3 x) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Integer 4 []) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.), verify: (Function (SymbolTable 4 {c: (Variable 4 c In () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), op_code: (Variable 4 op_code In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Local () () Default (Logical 4 []) Source Public Required .false.), y: (Variable 4 y Local () () Default (Logical 4 []) Source Public Required .false.)}) verify [(Var 4 c) (Var 4 op_code)] [] [(DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 x) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4 []) ()) Add (Var 4 k) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (= (Var 4 y) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 4 i) Mul (Var 4 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 4 j) Mul (Var 4 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 4 k) Mul (Var 4 j) (Integer 4 []) ()) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (Select (Var 4 op_code) [(CaseStmt [(IntegerConstant 0 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) And (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) Or (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 2 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) Eqv (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 3 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) NEqv (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])] [])])])])] () Source Public Implementation () .false. .false. .false.)}) array_op_3 [] [(Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))]) (2 b [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))]) (2 c [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))])] () () ()) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim1) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim2) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim3) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Logical 4 []) ()) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Logical 4 []) ()) (FunctionCall 2 modulo2 () [((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 k) Mul (Var 2 j) (Integer 4 []) ()) (Integer 4 []) ()))] (Logical 4 []) () ()) ())])])]) (= (Var 2 c) (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 0 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 a) Or (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 1 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 a) Eqv (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 2 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 b) NEqv (Var 2 a) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 3 (Integer 4 [])))] ()) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) +(TranslationUnit (SymbolTable 1 {array_op_3: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), b: (Variable 2 b Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c: (Variable 2 c Local () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), dim1: (Variable 2 dim1 Local (IntegerConstant 10 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), dim2: (Variable 2 dim2 Local (IntegerConstant 100 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), dim3: (Variable 2 dim3 Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), modulo2: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) modulo2 [(Var 3 x)] [] [(= (Var 3 r) (IntegerCompare (IntegerBinOp (Var 3 x) Sub (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (IntegerBinOp (Var 3 x) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) (Integer 4 []) ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.), verify: (Function (SymbolTable 4 {c: (Variable 4 c In () () Allocatable (Logical 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), op_code: (Variable 4 op_code In () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 4 x Local () () Default (Logical 4 []) Source Public Required .false.), y: (Variable 4 y Local () () Default (Logical 4 []) Source Public Required .false.)}) verify [(Var 4 c) (Var 4 op_code)] [] [(DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(= (Var 4 x) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (Var 4 i) Add (Var 4 j) (Integer 4 []) ()) Add (Var 4 k) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (= (Var 4 y) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 4 i) Mul (Var 4 j) (Integer 4 []) ()) Add (IntegerBinOp (Var 4 j) Mul (Var 4 k) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 4 k) Mul (Var 4 j) (Integer 4 []) ()) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (Select (Var 4 op_code) [(CaseStmt [(IntegerConstant 0 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) And (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) Or (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 2 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) Eqv (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 3 (Integer 4 []))] [(If (LogicalBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Logical 4 []) ()) NEqv (LogicalBinOp (Var 4 x) NEqv (Var 4 y) (Logical 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])] [])])])])] () Source Public Implementation () .false. .false. .false. .false.)}) array_op_3 [] [(Allocate [(2 a [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))]) (2 b [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))]) (2 c [((IntegerConstant 1 (Integer 4 [])) (Var 2 dim1)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim2)) ((IntegerConstant 1 (Integer 4 [])) (Var 2 dim3))])] () () ()) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim1) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim2) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (Var 2 dim3) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Logical 4 []) ()) (FunctionCall 2 modulo2 () [((IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()))] (Logical 4 []) () ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Logical 4 []) ()) (FunctionCall 2 modulo2 () [((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 k) Mul (Var 2 j) (Integer 4 []) ()) (Integer 4 []) ()))] (Logical 4 []) () ()) ())])])]) (= (Var 2 c) (LogicalBinOp (Var 2 a) And (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 0 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 a) Or (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 1 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 a) Eqv (Var 2 b) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 2 (Integer 4 [])))] ()) (= (Var 2 c) (LogicalBinOp (Var 2 b) NEqv (Var 2 a) (Logical 4 [(() ()) (() ()) (() ())]) ()) ()) (SubroutineCall 2 verify () [((Var 2 c)) ((IntegerConstant 3 (Integer 4 [])))] ()) (ImplicitDeallocate [2 a 2 b 2 c])])}) []) diff --git a/tests/reference/asr-arrays_op_5-9ff5901.json b/tests/reference/asr-arrays_op_5-9ff5901.json index 4cc69a9816..d6253c2b86 100644 --- a/tests/reference/asr-arrays_op_5-9ff5901.json +++ b/tests/reference/asr-arrays_op_5-9ff5901.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_5-9ff5901.stdout", - "stdout_hash": "5f65ef45e0ec8a2183d301b728ccfd006e5736ffe30cd7c6d253df3d", + "stdout_hash": "4cd084f87018bba33cada1f48ac732e4cc26874e22613176fc08165f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_op_5-9ff5901.stdout b/tests/reference/asr-arrays_op_5-9ff5901.stdout index 1683c285af..f2ba9b8e73 100644 --- a/tests/reference/asr-arrays_op_5-9ff5901.stdout +++ b/tests/reference/asr-arrays_op_5-9ff5901.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {array_op_5: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), check: (Function (SymbolTable 3 {c: (Variable 3 c In () () Default (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.), left: (Variable 3 left Local () () Default (Real 4 []) Source Public Required .false.), op_code: (Variable 3 op_code In () () Default (Integer 4 []) Source Public Required .false.), right: (Variable 3 right Local () () Default (Real 4 []) Source Public Required .false.)}) check [(Var 3 c) (Var 3 op_code)] [] [(DoLoop ((Var 3 i) (ArrayBound (Var 3 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 j) (ArrayBound (Var 3 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 k) (ArrayBound (Var 3 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(Select (Var 3 op_code) [(CaseStmt [(IntegerConstant 0 (Integer 4 []))] [(= (Var 3 left) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Add (Var 3 j) (Integer 4 []) ()) Add (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 3 right) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Mul (Var 3 j) (Integer 4 []) ()) Mul (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (If (ComplexCompare (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) NotEq (ComplexBinOp (Cast (Var 3 left) RealToComplex (Complex 4 []) ()) Add (ComplexBinOp (Cast (Var 3 right) RealToComplex (Complex 4 []) ()) Mul (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) (Complex 4 []) ()) (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(= (Var 3 left) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Add (Var 3 j) (Integer 4 []) ()) Add (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 3 right) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Mul (Var 3 j) (Integer 4 []) ()) Mul (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (If (ComplexCompare (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) NotEq (ComplexBinOp (Cast (RealUnaryMinus (Var 3 left) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) Sub (ComplexBinOp (Cast (Var 3 right) RealToComplex (Complex 4 []) ()) Mul (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) (Complex 4 []) ()) (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])] [])])])])] () Source Public Implementation () .false. .false. .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.)}) array_op_5 [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Integer 4 []) ()) (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Integer 4 []) ()) (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4 []) ()) Mul (Var 2 k) (Integer 4 []) ()) ())])])]) (= (Var 2 c) (ComplexBinOp (Cast (Var 2 a) IntegerToComplex (Complex 4 []) ()) Add (ComplexBinOp (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) Mul (Cast (Var 2 b) IntegerToComplex (Complex 4 []) ()) (Complex 4 []) ()) (Complex 4 []) ()) ()) (SubroutineCall 2 check () [((Var 2 c)) ((IntegerConstant 0 (Integer 4 [])))] ()) (= (Var 2 c) (ComplexBinOp (Cast (IntegerUnaryMinus (Var 2 a) (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) ()) IntegerToComplex (Complex 4 []) ()) Add (ComplexBinOp (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) Mul (Cast (IntegerUnaryMinus (Var 2 b) (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) ()) IntegerToComplex (Complex 4 []) ()) (Complex 4 []) ()) (Complex 4 []) ()) ()) (SubroutineCall 2 check () [((Var 2 c)) ((IntegerConstant 1 (Integer 4 [])))] ())])}) []) +(TranslationUnit (SymbolTable 1 {array_op_5: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 2 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Complex 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), check: (Function (SymbolTable 3 {c: (Variable 3 c In () () Default (Complex 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.), left: (Variable 3 left Local () () Default (Real 4 []) Source Public Required .false.), op_code: (Variable 3 op_code In () () Default (Integer 4 []) Source Public Required .false.), right: (Variable 3 right Local () () Default (Real 4 []) Source Public Required .false.)}) check [(Var 3 c) (Var 3 op_code)] [] [(DoLoop ((Var 3 i) (ArrayBound (Var 3 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 j) (ArrayBound (Var 3 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 3 k) (ArrayBound (Var 3 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 3 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(Select (Var 3 op_code) [(CaseStmt [(IntegerConstant 0 (Integer 4 []))] [(= (Var 3 left) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Add (Var 3 j) (Integer 4 []) ()) Add (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 3 right) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Mul (Var 3 j) (Integer 4 []) ()) Mul (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (If (ComplexCompare (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) NotEq (ComplexBinOp (Cast (Var 3 left) RealToComplex (Complex 4 []) ()) Add (ComplexBinOp (Cast (Var 3 right) RealToComplex (Complex 4 []) ()) Mul (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) (Complex 4 []) ()) (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])]) (CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(= (Var 3 left) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Add (Var 3 j) (Integer 4 []) ()) Add (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 3 right) (Cast (IntegerBinOp (IntegerBinOp (Var 3 i) Mul (Var 3 j) (Integer 4 []) ()) Mul (Var 3 k) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) ()) (If (ComplexCompare (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Complex 4 []) ()) NotEq (ComplexBinOp (Cast (RealUnaryMinus (Var 3 left) (Real 4 []) ()) RealToComplex (Complex 4 []) ()) Sub (ComplexBinOp (Cast (Var 3 right) RealToComplex (Complex 4 []) ()) Mul (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) (Complex 4 []) ()) (Complex 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])] [])])])])] () Source Public Implementation () .false. .false. .false. .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.)}) array_op_5 [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Integer 4 []) ()) (IntegerBinOp (IntegerBinOp (Var 2 i) Add (Var 2 j) (Integer 4 []) ()) Add (Var 2 k) (Integer 4 []) ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Integer 4 []) ()) (IntegerBinOp (IntegerBinOp (Var 2 i) Mul (Var 2 j) (Integer 4 []) ()) Mul (Var 2 k) (Integer 4 []) ()) ())])])]) (= (Var 2 c) (ComplexBinOp (Cast (Var 2 a) IntegerToComplex (Complex 4 []) ()) Add (ComplexBinOp (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) Mul (Cast (Var 2 b) IntegerToComplex (Complex 4 []) ()) (Complex 4 []) ()) (Complex 4 []) ()) ()) (SubroutineCall 2 check () [((Var 2 c)) ((IntegerConstant 0 (Integer 4 [])))] ()) (= (Var 2 c) (ComplexBinOp (Cast (IntegerUnaryMinus (Var 2 a) (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) ()) IntegerToComplex (Complex 4 []) ()) Add (ComplexBinOp (ComplexConstructor (RealConstant 0.000000 (Real 4 [])) (RealConstant 1.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 0.000000 1.000000 (Complex 4 []))) Mul (Cast (IntegerUnaryMinus (Var 2 b) (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) ()) IntegerToComplex (Complex 4 []) ()) (Complex 4 []) ()) (Complex 4 []) ()) ()) (SubroutineCall 2 check () [((Var 2 c)) ((IntegerConstant 1 (Integer 4 [])))] ())])}) []) diff --git a/tests/reference/asr-arrays_op_6-030b24e.json b/tests/reference/asr-arrays_op_6-030b24e.json index 2d71cfdcbd..078c75792d 100644 --- a/tests/reference/asr-arrays_op_6-030b24e.json +++ b/tests/reference/asr-arrays_op_6-030b24e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_6-030b24e.stdout", - "stdout_hash": "81225797b0a03a3f8fee30722b5e78cdbff5a1b2bd53e87cd2ced35e", + "stdout_hash": "81e724c10b082d72549e13d1c450b2b9df4816f80fdc35307ea98f90", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_op_6-030b24e.stdout b/tests/reference/asr-arrays_op_6-030b24e.stdout index 7b4f1f82a1..3c8860d70a 100644 --- a/tests/reference/asr-arrays_op_6-030b24e.stdout +++ b/tests/reference/asr-arrays_op_6-030b24e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {array_op_5: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), asquare: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), d: (Variable 3 d ReturnVar () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.)}) asquare [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(= (Var 3 d) (RealBinOp (RealBinOp (Var 3 a) Add (Var 3 b) (Real 4 [(() ()) (() ()) (() ())]) ()) Add (Var 3 c) (Real 4 [(() ()) (() ()) (() ())]) ()) ())] (Var 3 d) Source Public Implementation () .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), check: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.)}) check [(Var 4 c)] [] [(DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 4 []) ()) 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 [])) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false.), d: (Variable 2 d Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.)}) array_op_5 [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (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 []) ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) 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 []) ()) ()) (= (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ())])])]) (= (Var 2 d) (FunctionCall 2 asquare () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) () ()) ()) (SubroutineCall 2 check () [((Var 2 d))] ())])}) []) +(TranslationUnit (SymbolTable 1 {array_op_5: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), asquare: (Function (SymbolTable 3 {a: (Variable 3 a Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), c: (Variable 3 c Unspecified () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), d: (Variable 3 d ReturnVar () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.)}) asquare [(Var 3 a) (Var 3 b) (Var 3 c)] [] [(= (Var 3 d) (RealBinOp (RealBinOp (Var 3 a) Add (Var 3 b) (Real 4 [(() ()) (() ()) (() ())]) ()) Add (Var 3 c) (Real 4 [(() ()) (() ()) (() ())]) ()) ())] (Var 3 d) Source Public Implementation () .false. .false. .false. .false.), b: (Variable 2 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), check: (Function (SymbolTable 4 {c: (Variable 4 c In () () Default (Real 4 [(() ()) (() ()) (() ())]) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.)}) check [(Var 4 c)] [] [(DoLoop ((Var 4 i) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 j) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(DoLoop ((Var 4 k) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) LBound ()) (ArrayBound (Var 4 c) (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) UBound ()) ()) [(If (RealCompare (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 4 []) ()) 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 [])) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false. .false.), d: (Variable 2 d Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.)}) array_op_5 [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(DoLoop ((Var 2 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (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 []) ()) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) 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 []) ()) ()) (= (ArrayItem (Var 2 c) [(() (Var 2 i) ()) (() (Var 2 j) ()) (() (Var 2 k) ())] (Real 4 []) ()) (Cast (IntegerConstant 0 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ())])])]) (= (Var 2 d) (FunctionCall 2 asquare () [((Var 2 a)) ((Var 2 b)) ((Var 2 c))] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) () ()) ()) (SubroutineCall 2 check () [((Var 2 d))] ())])}) []) diff --git a/tests/reference/asr-arrays_op_7-52a6b5a.json b/tests/reference/asr-arrays_op_7-52a6b5a.json index 34b7075f7c..f26952d607 100644 --- a/tests/reference/asr-arrays_op_7-52a6b5a.json +++ b/tests/reference/asr-arrays_op_7-52a6b5a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_op_7-52a6b5a.stdout", - "stdout_hash": "367247a16279398a496bb3c5ad501db97bcb94259f6b98143de48377", + "stdout_hash": "3db9b199e9d3c2957c11ceda5a5c3bdd70b789cfb015e985ece03d73", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_op_7-52a6b5a.stdout b/tests/reference/asr-arrays_op_7-52a6b5a.stdout index 7975dcb414..d7e5ac3a71 100644 --- a/tests/reference/asr-arrays_op_7-52a6b5a.stdout +++ b/tests/reference/asr-arrays_op_7-52a6b5a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {arrays_op_7: (Program (SymbolTable 2 {f: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 [(() ())]) Source Public Required .false.), y: (Variable 3 y Out () () Default (Integer 4 [(() ())]) Source Public Required .false.)}) f [(Var 3 x) (Var 3 y)] [] [(= (Var 3 y) (Var 3 x) ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) arrays_op_7 [] [(= (Var 2 x) (IntegerConstant 3 (Integer 4 [])) ()) (SubroutineCall 2 f () [((Var 2 x)) ((Var 2 y))] ()) (Print () [(Var 2 y)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {arrays_op_7: (Program (SymbolTable 2 {f: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 [(() ())]) Source Public Required .false.), y: (Variable 3 y Out () () Default (Integer 4 [(() ())]) Source Public Required .false.)}) f [(Var 3 x) (Var 3 y)] [] [(= (Var 3 y) (Var 3 x) ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) arrays_op_7 [] [(= (Var 2 x) (IntegerConstant 3 (Integer 4 [])) ()) (SubroutineCall 2 f () [((Var 2 x)) ((Var 2 y))] ()) (Print () [(Var 2 y)] () ())])}) []) diff --git a/tests/reference/asr-arrays_reshape_14-913f34e.json b/tests/reference/asr-arrays_reshape_14-913f34e.json index b3a7ee59b2..f8d909748e 100644 --- a/tests/reference/asr-arrays_reshape_14-913f34e.json +++ b/tests/reference/asr-arrays_reshape_14-913f34e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-arrays_reshape_14-913f34e.stdout", - "stdout_hash": "9f1385e5c401fbc4429fccc32b8262b2fdb375cdf0cc1b51989ad542", + "stdout_hash": "9592df6a957ba3efc8785e0dd6a2012f08386c3c5e388a2535ce75a9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-arrays_reshape_14-913f34e.stdout b/tests/reference/asr-arrays_reshape_14-913f34e.stdout index 7119235d98..7e0f46b5de 100644 --- a/tests/reference/asr-arrays_reshape_14-913f34e.stdout +++ b/tests/reference/asr-arrays_reshape_14-913f34e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {array_reshape_14: (Program (SymbolTable 2 {test_1d_to_nd: (Function (SymbolTable 4 {a: (Variable 4 a Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), abs: (ExternalSymbol 4 abs 7 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 4 abs@dabs 7 dabs lfortran_intrinsic_math [] dabs Private), b: (Variable 4 b Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 4 c Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 4 d Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), eps: (Variable 4 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 4 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 4 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), newshape1: (Variable 4 newshape1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) test_1d_to_nd [(Var 4 d)] [] [(= (Var 4 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (Var 4 i) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 4 j) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 4 i) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (= (ArrayItem (Var 4 b) [(() (Var 4 k) ())] (Real 8 []) ()) (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 []) ()) ())]) (= (ArrayItem (Var 4 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (Var 4 a) (ArrayReshape (Var 4 b) (Var 4 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 a) [(() (Var 4 i) ()) (() (Var 4 j) ())] (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])]) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 3 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (Var 4 c) (ArrayReshape (Var 4 d) (Var 4 newshape1) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false.), test_nd_to_1d: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), abs: (ExternalSymbol 3 abs 7 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 3 abs@dabs 7 dabs lfortran_intrinsic_math [] dabs Private), b: (Variable 3 b Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 3 d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])))]) Source Public Required .false.), eps: (Variable 3 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 3 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 3 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), newshape1: (Variable 3 newshape1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.)}) test_nd_to_1d [(Var 3 a)] [] [(= (Var 3 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (= (ArrayItem (Var 3 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 256 (Integer 4 [])) ()) (= (Var 3 b) (ArrayReshape (Var 3 a) (Var 3 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 3 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 j) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 b) [(() (Var 3 k) ())] (Real 8 []) ()) 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 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 3 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 3 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Add (IntegerBinOp (Var 3 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())])])]) (= (ArrayItem (Var 3 newshape1) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 4096 (Integer 4 [])) ()) (= (Var 3 d) (ArrayReshape (Var 3 c) (Var 3 newshape1) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 3 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])) ()) [(= (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 j) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 d) [(() (Var 3 l) ())] (Real 8 []) ()) 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 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false.), test_reshape_with_argument: (Function (SymbolTable 5 {a: (Variable 5 a Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 5 d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 5 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 5 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 5 l Local () () Default (Integer 4 []) Source Public Required .false.)}) test_reshape_with_argument [] [] [(DoLoop ((Var 5 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 5 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 5 a) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (Var 5 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Add (IntegerBinOp (Var 5 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())])]) (SubroutineCall 2 test_nd_to_1d () [((Var 5 a))] ()) (DoLoop ((Var 5 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])) ()) [(= (Var 5 i) (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 5 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 5 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 j) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (= (ArrayItem (Var 5 d) [(() (Var 5 l) ())] (Real 8 []) ()) (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 []) ()) ())]) (SubroutineCall 2 test_1d_to_nd () [((Var 5 d))] ())] () Source Public Implementation () .false. .false. .false.)}) array_reshape_14 [] [(SubroutineCall 2 test_reshape_with_argument () [] ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) +(TranslationUnit (SymbolTable 1 {array_reshape_14: (Program (SymbolTable 2 {test_1d_to_nd: (Function (SymbolTable 4 {a: (Variable 4 a Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), abs: (ExternalSymbol 4 abs 7 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 4 abs@dabs 7 dabs lfortran_intrinsic_math [] dabs Private), b: (Variable 4 b Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 4 c Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 4 d Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), eps: (Variable 4 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 4 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 4 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 4 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 4 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), newshape1: (Variable 4 newshape1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) test_1d_to_nd [(Var 4 d)] [] [(= (Var 4 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (Var 4 i) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 4 j) (IntegerBinOp (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 4 i) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (= (ArrayItem (Var 4 b) [(() (Var 4 k) ())] (Real 8 []) ()) (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 []) ()) ())]) (= (ArrayItem (Var 4 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (Var 4 a) (ArrayReshape (Var 4 b) (Var 4 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 a) [(() (Var 4 i) ()) (() (Var 4 j) ())] (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])]) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (ArrayItem (Var 4 newshape1) [(() (IntegerConstant 3 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 16 (Integer 4 [])) ()) (= (Var 4 c) (ArrayReshape (Var 4 d) (Var 4 newshape1) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 4 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(If (RealCompare (FunctionCall 4 abs@dabs 4 abs [((RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 4 c) [(() (Var 4 i) ()) (() (Var 4 j) ()) (() (Var 4 k) ())] (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (IntegerBinOp (Var 4 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) IntegerToReal (Real 8 []) ()) (Real 8 []) ()) Sub (Cast (RealConstant 0.500000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.500000 (Real 8 []))) (Real 8 []) ()))] (Real 8 []) () ()) Gt (Var 4 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])])])] () Source Public Implementation () .false. .false. .false. .false.), test_nd_to_1d: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 8 [(() ()) (() ())]) Source Public Required .false.), abs: (ExternalSymbol 3 abs 7 abs lfortran_intrinsic_math [] abs Private), abs@dabs: (ExternalSymbol 3 abs@dabs 7 dabs lfortran_intrinsic_math [] dabs Private), b: (Variable 3 b Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 3 d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])))]) Source Public Required .false.), eps: (Variable 3 eps Local () () Default (Real 8 []) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 3 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 3 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 3 l Local () () Default (Integer 4 []) Source Public Required .false.), newshape: (Variable 3 newshape Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.), newshape1: (Variable 3 newshape1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 1 (Integer 4 [])))]) Source Public Required .false.)}) test_nd_to_1d [(Var 3 a)] [] [(= (Var 3 eps) (Cast (RealConstant 0.000000 (Real 4 [])) RealToReal (Real 8 []) (RealConstant 0.000000 (Real 8 []))) ()) (= (ArrayItem (Var 3 newshape) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 256 (Integer 4 [])) ()) (= (Var 3 b) (ArrayReshape (Var 3 a) (Var 3 newshape) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 3 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 256 (Integer 4 [])) ()) [(= (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 j) (IntegerBinOp (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 b) [(() (Var 3 k) ())] (Real 8 []) ()) 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 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]) (DoLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 3 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 3 k) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 3 c) [(() (Var 3 i) ()) (() (Var 3 j) ()) (() (Var 3 k) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Add (IntegerBinOp (Var 3 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Add (IntegerBinOp (Var 3 k) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())])])]) (= (ArrayItem (Var 3 newshape1) [(() (IntegerConstant 1 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 4096 (Integer 4 [])) ()) (= (Var 3 d) (ArrayReshape (Var 3 c) (Var 3 newshape1) (Real 8 [(() ())]) ()) ()) (DoLoop ((Var 3 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])) ()) [(= (Var 3 i) (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 3 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 3 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Sub (IntegerBinOp (Var 3 j) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (If (RealCompare (FunctionCall 3 abs@dabs 3 abs [((RealBinOp (RealBinOp (RealBinOp (RealBinOp (ArrayItem (Var 3 d) [(() (Var 3 l) ())] (Real 8 []) ()) 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 []) ()))] (Real 8 []) () ()) Gt (Var 3 eps) (Logical 4 []) ()) [(ErrorStop ())] [])])] () Source Public Implementation () .false. .false. .false. .false.), test_reshape_with_argument: (Function (SymbolTable 5 {a: (Variable 5 a Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 5 d Local () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 5 j Local () () Default (Integer 4 []) Source Public Required .false.), k: (Variable 5 k Local () () Default (Integer 4 []) Source Public Required .false.), l: (Variable 5 l Local () () Default (Integer 4 []) Source Public Required .false.)}) test_reshape_with_argument [] [] [(DoLoop ((Var 5 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(DoLoop ((Var 5 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 16 (Integer 4 [])) ()) [(= (ArrayItem (Var 5 a) [(() (Var 5 i) ()) (() (Var 5 j) ())] (Real 8 []) ()) (Cast (RealBinOp (Cast (IntegerBinOp (IntegerBinOp (Var 5 i) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Add (IntegerBinOp (Var 5 j) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) IntegerToReal (Real 4 []) ()) Add (RealConstant 0.500000 (Real 4 [])) (Real 4 []) ()) RealToReal (Real 8 []) ()) ())])]) (SubroutineCall 2 test_nd_to_1d () [((Var 5 a))] ()) (DoLoop ((Var 5 l) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4096 (Integer 4 [])) ()) [(= (Var 5 i) (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Div (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 5 j) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Div (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 5 k) (IntegerBinOp (IntegerBinOp (IntegerBinOp (Var 5 l) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 i) Mul (IntegerConstant 256 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) Sub (IntegerBinOp (Var 5 j) Mul (IntegerConstant 16 (Integer 4 [])) (Integer 4 []) ()) (Integer 4 []) ()) ()) (= (ArrayItem (Var 5 d) [(() (Var 5 l) ())] (Real 8 []) ()) (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 []) ()) ())]) (SubroutineCall 2 test_1d_to_nd () [((Var 5 d))] ())] () Source Public Implementation () .false. .false. .false. .false.)}) array_reshape_14 [] [(SubroutineCall 2 test_reshape_with_argument () [] ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) diff --git a/tests/reference/asr-block_03-6c8fdd8.json b/tests/reference/asr-block_03-6c8fdd8.json index 3087eeda78..c74e75e04a 100644 --- a/tests/reference/asr-block_03-6c8fdd8.json +++ b/tests/reference/asr-block_03-6c8fdd8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-block_03-6c8fdd8.stdout", - "stdout_hash": "1ba5a1c71ce15e35bbb75e719051f3e91f4a02e166709da032ec8af4", + "stdout_hash": "8c848afecdd11c0da4af74caa61b6e44d74269c6cac4f1c6ea4ecf88", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-block_03-6c8fdd8.stdout b/tests/reference/asr-block_03-6c8fdd8.stdout index c81dac7291..9edb81ee93 100644 --- a/tests/reference/asr-block_03-6c8fdd8.stdout +++ b/tests/reference/asr-block_03-6c8fdd8.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {block_02: (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)] []) (= (Var 4 b) (IntegerBinOp (Var 2 a) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ()) (SubroutineCall 1 square () [((Var 4 b))] ())])}) block_02 [] [(= (Var 2 a) (IntegerConstant 10 (Integer 4 [])) ()) (GoToTarget 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.)}) []) +(TranslationUnit (SymbolTable 1 {block_02: (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)] []) (= (Var 4 b) (IntegerBinOp (Var 2 a) Div (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ()) (SubroutineCall 1 square () [((Var 4 b))] ())])}) block_02 [] [(= (Var 2 a) (IntegerConstant 10 (Integer 4 [])) ()) (GoToTarget 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.)}) []) diff --git a/tests/reference/asr-callback_01-21b53de.json b/tests/reference/asr-callback_01-21b53de.json index bfdc215425..e8a0888bad 100644 --- a/tests/reference/asr-callback_01-21b53de.json +++ b/tests/reference/asr-callback_01-21b53de.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-callback_01-21b53de.stdout", - "stdout_hash": "b3c5de75d0cb36f4008a078733458828102d57cf9a4aabaeb89eb37e", + "stdout_hash": "ba5634cbfe06e5efaf1d4997490be7eb24823b9b2eb6a9bdea73d451", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-callback_01-21b53de.stdout b/tests/reference/asr-callback_01-21b53de.stdout index 98e1c5d691..5ec5c05ac5 100644 --- a/tests/reference/asr-callback_01-21b53de.stdout +++ b/tests/reference/asr-callback_01-21b53de.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {callback_01: (Module (SymbolTable 2 {cb: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), cb: (Variable 3 cb ReturnVar () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x)] [] [] (Var 4 f) Source Public Interface () .false. .false. .false.)}) cb [(Var 3 f) (Var 3 a) (Var 3 b)] [] [(= (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 []) ()) ())] (Var 3 cb) Source Public Implementation () .false. .false. .false.), foo: (Function (SymbolTable 5 {c: (Variable 5 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 5 d Unspecified () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 6 {f: (Variable 6 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 6 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 6 x)] [] [(= (Var 6 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 6 x) (Real 4 []) ()) ())] (Var 6 f) Source Public Implementation () .false. .false. .false.)}) foo [(Var 5 c) (Var 5 d)] [] [(Print () [(FunctionCall 2 cb () [((Var 5 f)) ((Var 5 c)) ((Var 5 d))] (Real 4 []) () ())] () ())] () Source Public Implementation () .false. .false. .false.)}) callback_01 [] .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 [])))] ())])}) []) +(TranslationUnit (SymbolTable 1 {callback_01: (Module (SymbolTable 2 {cb: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), cb: (Variable 3 cb ReturnVar () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x)] [] [] (Var 4 f) Source Public Interface () .false. .false. .false. .false.)}) cb [(Var 3 f) (Var 3 a) (Var 3 b)] [] [(= (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 []) ()) ())] (Var 3 cb) Source Public Implementation () .false. .false. .false. .false.), foo: (Function (SymbolTable 5 {c: (Variable 5 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 5 d Unspecified () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 6 {f: (Variable 6 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 6 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 6 x)] [] [(= (Var 6 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 6 x) (Real 4 []) ()) ())] (Var 6 f) Source Public Implementation () .false. .false. .false. .false.)}) foo [(Var 5 c) (Var 5 d)] [] [(Print () [(FunctionCall 2 cb () [((Var 5 f)) ((Var 5 c)) ((Var 5 d))] (Real 4 []) () ())] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) callback_01 [] .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 [])))] ())])}) []) diff --git a/tests/reference/asr-callback_02-aec5457.json b/tests/reference/asr-callback_02-aec5457.json index 5931a25ee2..62ce949d05 100644 --- a/tests/reference/asr-callback_02-aec5457.json +++ b/tests/reference/asr-callback_02-aec5457.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-callback_02-aec5457.stdout", - "stdout_hash": "728d29084c9338b0f927f92c075bbf9cd0e687446cedb3a01f9affa0", + "stdout_hash": "79725a4823382938793d6e38f2951aef83681cef0665fd10b04901be", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-callback_02-aec5457.stdout b/tests/reference/asr-callback_02-aec5457.stdout index 6fbb959833..41d64b19c4 100644 --- a/tests/reference/asr-callback_02-aec5457.stdout +++ b/tests/reference/asr-callback_02-aec5457.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {callback_02: (Module (SymbolTable 2 {cb: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {res: (Variable 4 res Unspecified () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x) (Var 4 res)] [] [] () Source Public Interface () .false. .false. .false.), res: (Variable 3 res Unspecified () () Default (Real 4 []) Source Public Required .false.)}) cb [(Var 3 res) (Var 3 a) (Var 3 b) (Var 3 f)] [] [(SubroutineCall 3 f () [((Var 3 a)) ((Var 3 res))] ()) (Print () [(Var 3 res)] () ()) (SubroutineCall 3 f () [((Var 3 b)) ((Var 3 res))] ()) (Print () [(Var 3 res)] () ()) (= (Var 3 res) (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4 []) ()) Mul (Var 3 res) (Real 4 []) ()) ()) (Print () [(Var 3 res)] () ())] () Source Public Implementation () .false. .false. .false.), foo: (Function (SymbolTable 5 {c: (Variable 5 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 5 d Unspecified () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 6 {res: (Variable 6 res Unspecified () () Default (Real 4 []) Source Public Required .false.), x: (Variable 6 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 6 x) (Var 6 res)] [] [(= (Var 6 res) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 6 x) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.), foo: (Variable 5 foo ReturnVar () () Default (Real 4 []) Source Public Required .false.), res: (Variable 5 res Unspecified () () Default (Real 4 []) Source Public Required .false.)}) foo [(Var 5 c) (Var 5 d) (Var 5 res)] [] [(SubroutineCall 2 cb () [((Var 5 res)) ((Var 5 c)) ((Var 5 d)) ((Var 5 f))] ()) (= (Var 5 foo) (Var 5 res) ())] (Var 5 foo) Source Public Implementation () .false. .false. .false.)}) callback_02 [] .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 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) main [callback_02] [(= (Var 7 res) (FunctionCall 7 foo () [((RealConstant 1.500000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 []))) ((Var 7 res))] (Real 4 []) () ()) ())])}) []) +(TranslationUnit (SymbolTable 1 {callback_02: (Module (SymbolTable 2 {cb: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {res: (Variable 4 res Unspecified () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x) (Var 4 res)] [] [] () Source Public Interface () .false. .false. .false. .false.), res: (Variable 3 res Unspecified () () Default (Real 4 []) Source Public Required .false.)}) cb [(Var 3 res) (Var 3 a) (Var 3 b) (Var 3 f)] [] [(SubroutineCall 3 f () [((Var 3 a)) ((Var 3 res))] ()) (Print () [(Var 3 res)] () ()) (SubroutineCall 3 f () [((Var 3 b)) ((Var 3 res))] ()) (Print () [(Var 3 res)] () ()) (= (Var 3 res) (RealBinOp (RealBinOp (Var 3 b) Sub (Var 3 a) (Real 4 []) ()) Mul (Var 3 res) (Real 4 []) ()) ()) (Print () [(Var 3 res)] () ())] () Source Public Implementation () .false. .false. .false. .false.), foo: (Function (SymbolTable 5 {c: (Variable 5 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 5 d Unspecified () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 6 {res: (Variable 6 res Unspecified () () Default (Real 4 []) Source Public Required .false.), x: (Variable 6 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 6 x) (Var 6 res)] [] [(= (Var 6 res) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 6 x) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.), foo: (Variable 5 foo ReturnVar () () Default (Real 4 []) Source Public Required .false.), res: (Variable 5 res Unspecified () () Default (Real 4 []) Source Public Required .false.)}) foo [(Var 5 c) (Var 5 d) (Var 5 res)] [] [(SubroutineCall 2 cb () [((Var 5 res)) ((Var 5 c)) ((Var 5 d)) ((Var 5 f))] ()) (= (Var 5 foo) (Var 5 res) ())] (Var 5 foo) Source Public Implementation () .false. .false. .false. .false.)}) callback_02 [] .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 [])) IntegerToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) main [callback_02] [(= (Var 7 res) (FunctionCall 7 foo () [((RealConstant 1.500000 (Real 4 []))) ((RealConstant 2.000000 (Real 4 []))) ((Var 7 res))] (Real 4 []) () ()) ())])}) []) diff --git a/tests/reference/asr-class_01-704dee8.json b/tests/reference/asr-class_01-704dee8.json index 3ecdfab9d9..20b95b5c2e 100644 --- a/tests/reference/asr-class_01-704dee8.json +++ b/tests/reference/asr-class_01-704dee8.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-class_01-704dee8.stdout", - "stdout_hash": "82023f8a7f1ca448f27dc3d94db41107cb5c80b55e2106f354b96d48", + "stdout_hash": "1460112d2e6e699fa0e94e8a44d2d90a2e8042d226fddce0f151ce8f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-class_01-704dee8.stdout b/tests/reference/asr-class_01-704dee8.stdout index 2246bf1fb3..81d7bca418 100644 --- a/tests/reference/asr-class_01-704dee8.stdout +++ b/tests/reference/asr-class_01-704dee8.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {circle_test: (Program (SymbolTable 6 {c: (Variable 6 c Local () () Default (Derived 6 circle []) Source Private Required .false.), circle: (ExternalSymbol 6 circle 2 circle class_circle1 [] circle Private)}) circle_test [class_circle1] [(= (Var 6 c) (DerivedTypeConstructor 6 circle [(RealConstant 1.500000 (Real 4 []))] (Derived 6 circle []) ()) ()) (SubroutineCall 3 print () [] (Var 6 c)) (= (DerivedRef (Var 6 c) 3 radius (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ()) (SubroutineCall 3 print () [] (Var 6 c))]), class_circle1: (Module (SymbolTable 2 {circle: (DerivedType (SymbolTable 3 {area: (ClassProcedure 3 area circle_area 2 circle_area Source), print: (ClassProcedure 3 print circle_print 2 circle_print Source), radius: (Variable 3 radius Local () () Default (Real 4 []) Source Private Required .false.)}) circle [radius] Source Private ()), circle_area: (Function (SymbolTable 4 {area: (Variable 4 area ReturnVar () () Default (Real 4 []) Source Private Required .false.), this: (Variable 4 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_area [(Var 4 this)] [] [(= (Var 4 area) (RealBinOp (Var 2 pi) Mul (RealBinOp (DerivedRef (Var 4 this) 3 radius (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()) ())] (Var 4 area) Source Private Implementation () .false. .false. .false.), circle_print: (Function (SymbolTable 5 {area: (Variable 5 area Local () () Default (Real 4 []) Source Private Required .false.), this: (Variable 5 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_print [(Var 5 this)] [] [(= (Var 5 area) (FunctionCall 3 area () [] (Real 4 []) () (Var 5 this)) ()) (Print () [(StringConstant "Circle: r = " (Character 1 12 () [])) (DerivedRef (Var 5 this) 3 radius (Real 4 []) ()) (StringConstant " area = " (Character 1 8 () [])) (Var 5 area)] () ())] () Source Private Implementation () .false. .false. .false.), pi: (Variable 2 pi Local (Cast (RealConstant 3.141593 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.141593 (Real 4 []))) () Save (Real 4 []) Source Private Required .false.)}) class_circle1 [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {circle_test: (Program (SymbolTable 6 {c: (Variable 6 c Local () () Default (Derived 6 circle []) Source Private Required .false.), circle: (ExternalSymbol 6 circle 2 circle class_circle1 [] circle Private)}) circle_test [class_circle1] [(= (Var 6 c) (DerivedTypeConstructor 6 circle [(RealConstant 1.500000 (Real 4 []))] (Derived 6 circle []) ()) ()) (SubroutineCall 3 print () [] (Var 6 c)) (= (DerivedRef (Var 6 c) 3 radius (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ()) (SubroutineCall 3 print () [] (Var 6 c))]), class_circle1: (Module (SymbolTable 2 {circle: (DerivedType (SymbolTable 3 {area: (ClassProcedure 3 area circle_area 2 circle_area Source), print: (ClassProcedure 3 print circle_print 2 circle_print Source), radius: (Variable 3 radius Local () () Default (Real 4 []) Source Private Required .false.)}) circle [radius] Source Private ()), circle_area: (Function (SymbolTable 4 {area: (Variable 4 area ReturnVar () () Default (Real 4 []) Source Private Required .false.), this: (Variable 4 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_area [(Var 4 this)] [] [(= (Var 4 area) (RealBinOp (Var 2 pi) Mul (RealBinOp (DerivedRef (Var 4 this) 3 radius (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()) ())] (Var 4 area) Source Private Implementation () .false. .false. .false. .false.), circle_print: (Function (SymbolTable 5 {area: (Variable 5 area Local () () Default (Real 4 []) Source Private Required .false.), this: (Variable 5 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_print [(Var 5 this)] [] [(= (Var 5 area) (FunctionCall 3 area () [] (Real 4 []) () (Var 5 this)) ()) (Print () [(StringConstant "Circle: r = " (Character 1 12 () [])) (DerivedRef (Var 5 this) 3 radius (Real 4 []) ()) (StringConstant " area = " (Character 1 8 () [])) (Var 5 area)] () ())] () Source Private Implementation () .false. .false. .false. .false.), pi: (Variable 2 pi Local (Cast (RealConstant 3.141593 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.141593 (Real 4 []))) () Save (Real 4 []) Source Private Required .false.)}) class_circle1 [] .false. .false.)}) []) diff --git a/tests/reference/asr-class_02-b56b852.json b/tests/reference/asr-class_02-b56b852.json index d1b08583ca..6b9bb21743 100644 --- a/tests/reference/asr-class_02-b56b852.json +++ b/tests/reference/asr-class_02-b56b852.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-class_02-b56b852.stdout", - "stdout_hash": "200e34ddceeb095c18df762b8821004b24578f8f20da5a5d25192bf3", + "stdout_hash": "97d7dd93c002a92a08ce207357892f8ee839accc806cbcd52c7651fb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-class_02-b56b852.stdout b/tests/reference/asr-class_02-b56b852.stdout index 15960012c5..7614960435 100644 --- a/tests/reference/asr-class_02-b56b852.stdout +++ b/tests/reference/asr-class_02-b56b852.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {circle_test: (Program (SymbolTable 7 {main: (ExternalSymbol 7 main 2 main class_circle2 [] main Private)}) circle_test [class_circle2] [(SubroutineCall 7 main () [] ())]), class_circle2: (Module (SymbolTable 2 {circle: (DerivedType (SymbolTable 3 {circle_area: (ClassProcedure 3 circle_area circle_area 2 circle_area Source), circle_print: (ClassProcedure 3 circle_print circle_print 2 circle_print Source), radius: (Variable 3 radius Local () () Default (Real 4 []) Source Private Required .false.)}) circle [radius] Source Private ()), circle_area: (Function (SymbolTable 4 {circle_area: (Variable 4 circle_area ReturnVar () () Default (Real 4 []) Source Public Required .false.), this: (Variable 4 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_area [(Var 4 this)] [] [(= (Var 4 circle_area) (RealBinOp (Var 2 pi) Mul (RealBinOp (DerivedRef (Var 4 this) 3 radius (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()) ())] (Var 4 circle_area) Source Private Implementation () .false. .false. .false.), circle_print: (Function (SymbolTable 5 {area: (Variable 5 area Local () () Default (Real 4 []) Source Private Required .false.), this: (Variable 5 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_print [(Var 5 this)] [] [(= (Var 5 area) (FunctionCall 3 circle_area () [] (Real 4 []) () (Var 5 this)) ()) (Print () [(StringConstant "Circle: r = " (Character 1 12 () [])) (DerivedRef (Var 5 this) 3 radius (Real 4 []) ()) (StringConstant " area = " (Character 1 8 () [])) (Var 5 area)] () ())] () Source Private Implementation () .false. .false. .false.), main: (Function (SymbolTable 6 {c: (Variable 6 c Local () () Default (Derived 2 circle []) Source Private Required .false.)}) main [] [] [(= (Var 6 c) (DerivedTypeConstructor 2 circle [(RealConstant 1.000000 (Real 4 []))] (Derived 2 circle []) ()) ()) (= (DerivedRef (Var 6 c) 3 radius (Real 4 []) ()) (RealConstant 1.500000 (Real 4 [])) ()) (SubroutineCall 3 circle_print () [] (Var 6 c))] () Source Public Implementation () .false. .false. .false.), pi: (Variable 2 pi Local (Cast (RealConstant 3.141593 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.141593 (Real 4 []))) () Save (Real 4 []) Source Private Required .false.)}) class_circle2 [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {circle_test: (Program (SymbolTable 7 {main: (ExternalSymbol 7 main 2 main class_circle2 [] main Private)}) circle_test [class_circle2] [(SubroutineCall 7 main () [] ())]), class_circle2: (Module (SymbolTable 2 {circle: (DerivedType (SymbolTable 3 {circle_area: (ClassProcedure 3 circle_area circle_area 2 circle_area Source), circle_print: (ClassProcedure 3 circle_print circle_print 2 circle_print Source), radius: (Variable 3 radius Local () () Default (Real 4 []) Source Private Required .false.)}) circle [radius] Source Private ()), circle_area: (Function (SymbolTable 4 {circle_area: (Variable 4 circle_area ReturnVar () () Default (Real 4 []) Source Public Required .false.), this: (Variable 4 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_area [(Var 4 this)] [] [(= (Var 4 circle_area) (RealBinOp (Var 2 pi) Mul (RealBinOp (DerivedRef (Var 4 this) 3 radius (Real 4 []) ()) Pow (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) (Real 4 []) ()) (Real 4 []) ()) ())] (Var 4 circle_area) Source Private Implementation () .false. .false. .false. .false.), circle_print: (Function (SymbolTable 5 {area: (Variable 5 area Local () () Default (Real 4 []) Source Private Required .false.), this: (Variable 5 this In () () Default (Class 2 circle []) Source Private Required .false.)}) circle_print [(Var 5 this)] [] [(= (Var 5 area) (FunctionCall 3 circle_area () [] (Real 4 []) () (Var 5 this)) ()) (Print () [(StringConstant "Circle: r = " (Character 1 12 () [])) (DerivedRef (Var 5 this) 3 radius (Real 4 []) ()) (StringConstant " area = " (Character 1 8 () [])) (Var 5 area)] () ())] () Source Private Implementation () .false. .false. .false. .false.), main: (Function (SymbolTable 6 {c: (Variable 6 c Local () () Default (Derived 2 circle []) Source Private Required .false.)}) main [] [] [(= (Var 6 c) (DerivedTypeConstructor 2 circle [(RealConstant 1.000000 (Real 4 []))] (Derived 2 circle []) ()) ()) (= (DerivedRef (Var 6 c) 3 radius (Real 4 []) ()) (RealConstant 1.500000 (Real 4 [])) ()) (SubroutineCall 3 circle_print () [] (Var 6 c))] () Source Public Implementation () .false. .false. .false. .false.), pi: (Variable 2 pi Local (Cast (RealConstant 3.141593 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 3.141593 (Real 4 []))) () Save (Real 4 []) Source Private Required .false.)}) class_circle2 [] .false. .false.)}) []) diff --git a/tests/reference/asr-continue_body_if_loop-670a23a.json b/tests/reference/asr-continue_body_if_loop-670a23a.json new file mode 100644 index 0000000000..6306a456fa --- /dev/null +++ b/tests/reference/asr-continue_body_if_loop-670a23a.json @@ -0,0 +1,13 @@ +{ + "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": "7c427401f472a1acfa09468084f80f708554b38d8fcf1f528d0d922d", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-continue_body_if_loop-670a23a.stdout b/tests/reference/asr-continue_body_if_loop-670a23a.stdout new file mode 100644 index 0000000000..fcda9a8172 --- /dev/null +++ b/tests/reference/asr-continue_body_if_loop-670a23a.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {implicit_program_lfortran: (Program (SymbolTable 2 {j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 2 s Local () () Default (Real 4 []) Source Public Required .false.), u: (Variable 2 u Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 100 (Integer 4 [])))]) Source Public Required .false.)}) implicit_program_lfortran [] [(= (Var 2 s) (RealConstant 0.000000 (Real 4 [])) ()) (DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 100 (Integer 4 [])) ()) [(= (Var 2 s) (RealBinOp (Var 2 s) Add (ArrayItem (Var 2 u) [(() (Var 2 j) ())] (Real 4 []) ()) (Real 4 []) ()) ()) (If (RealCompare (Var 2 s) GtE (Cast (IntegerConstant 1000000 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1000000.000000 (Real 4 []))) (Logical 4 []) ()) [(GoTo 2)] []) (GoToTarget 1)]) (Stop ()) (GoToTarget 2)])}) []) diff --git a/tests/reference/asr-derived_types_01-960dafe.json b/tests/reference/asr-derived_types_01-960dafe.json index f173740106..0f24b91dbb 100644 --- a/tests/reference/asr-derived_types_01-960dafe.json +++ b/tests/reference/asr-derived_types_01-960dafe.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_01-960dafe.stdout", - "stdout_hash": "397d51b937f61079c60c15f93eeb84ad5f55170634cb2c58702bb6c1", + "stdout_hash": "eaf99be33634014cb35324e7122e21f3bfd23cd01a765664426a470d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_01-960dafe.stdout b/tests/reference/asr-derived_types_01-960dafe.stdout index 13e7622c03..05fd080c23 100644 --- a/tests/reference/asr-derived_types_01-960dafe.stdout +++ b/tests/reference/asr-derived_types_01-960dafe.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a_01: (Module (SymbolTable 2 {set: (Function (SymbolTable 5 {a: (Variable 5 a Out () () Default (Derived 2 x []) Source Public Required .false.)}) set [(Var 5 a)] [] [(= (DerivedRef (Var 5 a) 3 i (Integer 4 []) ()) (IntegerConstant 1 (Integer 4 [])) ()) (= (DerivedRef (Var 5 a) 3 r (Real 4 []) ()) (RealConstant 1.500000 (Real 4 [])) ())] () Source Public Implementation () .false. .false. .false.), x: (DerivedType (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.)}) x [r i] Source Public ()), y: (DerivedType (SymbolTable 4 {c: (Variable 4 c Local () () Default (Complex 4 []) Source Public Required .false.), d: (Variable 4 d Local () () Default (Derived 2 x []) Source Public Required .false.)}) y [c d] Source Public ())}) a_01 [] .false. .false.), a_02: (Module (SymbolTable 6 {y: (ExternalSymbol 6 y 2 y a_01 [] y Public), z: (DerivedType (SymbolTable 7 {k: (Variable 7 k Local () () Default (Complex 4 []) Source Public Required .false.), l: (Variable 7 l Local () () Default (Derived 6 y []) Source Public Required .false.)}) z [k l] Source Public ())}) a_02 [a_01] .false. .false.), derived_types_01: (Program (SymbolTable 8 {1_a_01_y: (ExternalSymbol 8 1_a_01_y 2 y a_01 [] y Public), b: (Variable 8 b Local () () Default (Derived 8 x []) Source Public Required .false.), c: (Variable 8 c Local () () Default (Derived 8 z []) Source Public Required .false.), set: (ExternalSymbol 8 set 2 set a_01 [] set Public), x: (ExternalSymbol 8 x 2 x a_01 [] x Public), z: (ExternalSymbol 8 z 6 z a_02 [] z Public)}) derived_types_01 [a_02 a_01] [(= (DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (IntegerConstant 5 (Integer 4 [])) ()) (= (DerivedRef (Var 8 b) 3 r (Real 4 []) ()) (RealConstant 3.500000 (Real 4 [])) ()) (Print () [(DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 b) 3 r (Real 4 []) ())] () ()) (SubroutineCall 8 set () [((Var 8 b))] ()) (Print () [(DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 b) 3 r (Real 4 []) ())] () ()) (= (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ()) (= (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ()) (= (DerivedRef (Var 8 c) 7 k (Complex 4 []) ()) (ComplexConstructor (RealConstant 2.000000 (Real 4 [])) (RealConstant 2.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 2.000000 2.000000 (Complex 4 []))) ()) (Print () [(DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 c) 7 k (Complex 4 []) ())] () ()) (SubroutineCall 8 set () [((DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()))] ()) (Print () [(DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 c) 7 k (Complex 4 []) ())] () ())])}) []) +(TranslationUnit (SymbolTable 1 {a_01: (Module (SymbolTable 2 {set: (Function (SymbolTable 5 {a: (Variable 5 a Out () () Default (Derived 2 x []) Source Public Required .false.)}) set [(Var 5 a)] [] [(= (DerivedRef (Var 5 a) 3 i (Integer 4 []) ()) (IntegerConstant 1 (Integer 4 [])) ()) (= (DerivedRef (Var 5 a) 3 r (Real 4 []) ()) (RealConstant 1.500000 (Real 4 [])) ())] () Source Public Implementation () .false. .false. .false. .false.), x: (DerivedType (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.)}) x [r i] Source Public ()), y: (DerivedType (SymbolTable 4 {c: (Variable 4 c Local () () Default (Complex 4 []) Source Public Required .false.), d: (Variable 4 d Local () () Default (Derived 2 x []) Source Public Required .false.)}) y [c d] Source Public ())}) a_01 [] .false. .false.), a_02: (Module (SymbolTable 6 {y: (ExternalSymbol 6 y 2 y a_01 [] y Public), z: (DerivedType (SymbolTable 7 {k: (Variable 7 k Local () () Default (Complex 4 []) Source Public Required .false.), l: (Variable 7 l Local () () Default (Derived 6 y []) Source Public Required .false.)}) z [k l] Source Public ())}) a_02 [a_01] .false. .false.), derived_types_01: (Program (SymbolTable 8 {1_a_01_y: (ExternalSymbol 8 1_a_01_y 2 y a_01 [] y Public), b: (Variable 8 b Local () () Default (Derived 8 x []) Source Public Required .false.), c: (Variable 8 c Local () () Default (Derived 8 z []) Source Public Required .false.), set: (ExternalSymbol 8 set 2 set a_01 [] set Public), x: (ExternalSymbol 8 x 2 x a_01 [] x Public), z: (ExternalSymbol 8 z 6 z a_02 [] z Public)}) derived_types_01 [a_02 a_01] [(= (DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (IntegerConstant 5 (Integer 4 [])) ()) (= (DerivedRef (Var 8 b) 3 r (Real 4 []) ()) (RealConstant 3.500000 (Real 4 [])) ()) (Print () [(DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 b) 3 r (Real 4 []) ())] () ()) (SubroutineCall 8 set () [((Var 8 b))] ()) (Print () [(DerivedRef (Var 8 b) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 b) 3 r (Real 4 []) ())] () ()) (= (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ()) (= (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ()) (= (DerivedRef (Var 8 c) 7 k (Complex 4 []) ()) (ComplexConstructor (RealConstant 2.000000 (Real 4 [])) (RealConstant 2.000000 (Real 4 [])) (Complex 4 []) (ComplexConstant 2.000000 2.000000 (Complex 4 []))) ()) (Print () [(DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 c) 7 k (Complex 4 []) ())] () ()) (SubroutineCall 8 set () [((DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()))] ()) (Print () [(DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 r (Real 4 []) ()) (DerivedRef (DerivedRef (DerivedRef (Var 8 c) 7 l (Derived 8 1_a_01_y []) ()) 4 d (Derived 8 x []) ()) 3 i (Integer 4 []) ()) (DerivedRef (Var 8 c) 7 k (Complex 4 []) ())] () ())])}) []) diff --git a/tests/reference/asr-derived_types_03-b1d32aa.json b/tests/reference/asr-derived_types_03-b1d32aa.json index bf69385af6..9aa43fc81e 100644 --- a/tests/reference/asr-derived_types_03-b1d32aa.json +++ b/tests/reference/asr-derived_types_03-b1d32aa.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_03-b1d32aa.stdout", - "stdout_hash": "0539d13f3206905780ee4674b9e39ac590dc1045dd5c2a59a5ff7dd4", + "stdout_hash": "c2730fe9bb5c1ca46a61a1b706d94f7c557709d7495129096a2cd80e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_03-b1d32aa.stdout b/tests/reference/asr-derived_types_03-b1d32aa.stdout index e47c030f0b..86415dfdd3 100644 --- a/tests/reference/asr-derived_types_03-b1d32aa.stdout +++ b/tests/reference/asr-derived_types_03-b1d32aa.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {derived_types_03: (Program (SymbolTable 2 {b: (Variable 2 b Local () () Default (Derived 2 x []) Source Public Required .false.), x: (DerivedType (SymbolTable 3 {i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.)}) x [i] Source Public ()), y: (Function (SymbolTable 4 {a: (DerivedType (SymbolTable 5 {i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.)}) a [i] Source Public ()), b: (Variable 4 b Local () () Default (Derived 4 a []) Source Public Required .false.)}) y [] [] [] () Source Public Implementation () .false. .false. .false.), z: (Function (SymbolTable 6 {a: (DerivedType (SymbolTable 7 {i: (Variable 7 i Local () () Default (Integer 4 []) Source Public Required .false.)}) a [i] Source Public ()), b: (Variable 6 b Local () () Default (Derived 6 a []) Source Public Required .false.), z: (Variable 6 z ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) z [] [] [(= (Var 6 z) (IntegerConstant 5 (Integer 4 [])) ())] (Var 6 z) Source Public Implementation () .false. .false. .false.)}) derived_types_03 [] [])}) []) +(TranslationUnit (SymbolTable 1 {derived_types_03: (Program (SymbolTable 2 {b: (Variable 2 b Local () () Default (Derived 2 x []) Source Public Required .false.), x: (DerivedType (SymbolTable 3 {i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.)}) x [i] Source Public ()), y: (Function (SymbolTable 4 {a: (DerivedType (SymbolTable 5 {i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.)}) a [i] Source Public ()), b: (Variable 4 b Local () () Default (Derived 4 a []) Source Public Required .false.)}) y [] [] [] () Source Public Implementation () .false. .false. .false. .false.), z: (Function (SymbolTable 6 {a: (DerivedType (SymbolTable 7 {i: (Variable 7 i Local () () Default (Integer 4 []) Source Public Required .false.)}) a [i] Source Public ()), b: (Variable 6 b Local () () Default (Derived 6 a []) Source Public Required .false.), z: (Variable 6 z ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) z [] [] [(= (Var 6 z) (IntegerConstant 5 (Integer 4 [])) ())] (Var 6 z) Source Public Implementation () .false. .false. .false. .false.)}) derived_types_03 [] [])}) []) diff --git a/tests/reference/asr-derived_types_04-b960162.json b/tests/reference/asr-derived_types_04-b960162.json index 81fa75fa57..39afa16a57 100644 --- a/tests/reference/asr-derived_types_04-b960162.json +++ b/tests/reference/asr-derived_types_04-b960162.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_04-b960162.stdout", - "stdout_hash": "690a36743a9126245f30898fa95e688ab958fc30a89bc429108e63a1", + "stdout_hash": "dbc148810a39130916bafc22cbe8d2d2285557e3fe6eef119e84beae", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_04-b960162.stdout b/tests/reference/asr-derived_types_04-b960162.stdout index a308e6c90a..484ee861f5 100644 --- a/tests/reference/asr-derived_types_04-b960162.stdout +++ b/tests/reference/asr-derived_types_04-b960162.stdout @@ -1 +1 @@ -(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.), bitset_type: (DerivedType (SymbolTable 3 {all: (ClassProcedure 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 [] [])}) []) +(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.), bitset_type: (DerivedType (SymbolTable 3 {all: (ClassProcedure 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 [] [])}) []) diff --git a/tests/reference/asr-derived_types_05-35150cd.json b/tests/reference/asr-derived_types_05-35150cd.json index 0be393ca72..4eb600337f 100644 --- a/tests/reference/asr-derived_types_05-35150cd.json +++ b/tests/reference/asr-derived_types_05-35150cd.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_05-35150cd.stdout", - "stdout_hash": "28d73162cdc59fdefe0c196172ae9ba8afe49e61b3b44a43b3bdc8b2", + "stdout_hash": "e600bc816870d49211803526d1d807d3a8317b7605b91c68268f2595", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_05-35150cd.stdout b/tests/reference/asr-derived_types_05-35150cd.stdout index 31e7d41920..6a8ce18d60 100644 --- a/tests/reference/asr-derived_types_05-35150cd.stdout +++ b/tests/reference/asr-derived_types_05-35150cd.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {derived_type_05: (Program (SymbolTable 13 {}) derived_type_05 [] []), stdlib_string_type: (Module (SymbolTable 2 {new_string: (Function (SymbolTable 4 {new: (Variable 4 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), string: (Variable 4 string In () () Default (Character 1 -1 () []) Source Public Optional .false.)}) new_string [(Var 4 string)] [] [] (Var 4 new) Source Public Interface () .true. .false. .false.), new_string_from_integer_int32: (Function (SymbolTable 5 {new: (Variable 5 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 5 val In () () Default (Integer 4 []) Source Public Required .false.)}) new_string_from_integer_int32 [(Var 5 val)] [] [] (Var 5 new) Source Public Interface () .true. .false. .false.), new_string_from_integer_int64: (Function (SymbolTable 6 {new: (Variable 6 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 6 val In () () Default (Integer 8 []) Source Public Required .false.)}) new_string_from_integer_int64 [(Var 6 val)] [] [] (Var 6 new) Source Public Interface () .true. .false. .false.), new_string_from_logical_lk: (Function (SymbolTable 7 {new: (Variable 7 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 7 val In () () Default (Logical 4 []) Source Public Required .false.)}) new_string_from_logical_lk [(Var 7 val)] [] [] (Var 7 new) Source Public Interface () .true. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ()), ~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)}) stdlib_string_type [] .false. .false.), stdlib_string_type_constructor: (Module (SymbolTable 8 {new_string: (Function (SymbolTable 9 {new: (Variable 9 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), string: (Variable 9 string In () () Default (Character 1 -1 () []) Source Public Optional .false.)}) new_string [(Var 9 string)] [] [] (Var 9 new) Source Public Implementation () .true. .false. .false.), new_string_from_integer_int32: (Function (SymbolTable 10 {new: (Variable 10 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 10 val In () () Default (Integer 4 []) Source Public Required .false.)}) new_string_from_integer_int32 [(Var 10 val)] [] [] (Var 10 new) Source Public Implementation () .true. .false. .false.), new_string_from_integer_int64: (Function (SymbolTable 11 {new: (Variable 11 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 11 val In () () Default (Integer 8 []) Source Public Required .false.)}) new_string_from_integer_int64 [(Var 11 val)] [] [] (Var 11 new) Source Public Implementation () .true. .false. .false.), new_string_from_logical_lk: (Function (SymbolTable 12 {new: (Variable 12 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 12 val In () () Default (Logical 4 []) Source Public Required .false.)}) new_string_from_logical_lk [(Var 12 val)] [] [] (Var 12 new) Source Public Implementation () .true. .false. .false.), string_type: (ExternalSymbol 8 string_type 2 string_type stdlib_string_type [] string_type Public), ~string_type: (ExternalSymbol 8 ~string_type 2 ~string_type stdlib_string_type [] ~string_type Public)}) stdlib_string_type_constructor [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {derived_type_05: (Program (SymbolTable 13 {}) derived_type_05 [] []), stdlib_string_type: (Module (SymbolTable 2 {new_string: (Function (SymbolTable 4 {new: (Variable 4 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), string: (Variable 4 string In () () Default (Character 1 -1 () []) Source Public Optional .false.)}) new_string [(Var 4 string)] [] [] (Var 4 new) Source Public Interface () .true. .false. .false. .false.), new_string_from_integer_int32: (Function (SymbolTable 5 {new: (Variable 5 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 5 val In () () Default (Integer 4 []) Source Public Required .false.)}) new_string_from_integer_int32 [(Var 5 val)] [] [] (Var 5 new) Source Public Interface () .true. .false. .false. .false.), new_string_from_integer_int64: (Function (SymbolTable 6 {new: (Variable 6 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 6 val In () () Default (Integer 8 []) Source Public Required .false.)}) new_string_from_integer_int64 [(Var 6 val)] [] [] (Var 6 new) Source Public Interface () .true. .false. .false. .false.), new_string_from_logical_lk: (Function (SymbolTable 7 {new: (Variable 7 new ReturnVar () () Default (Derived 2 string_type []) Source Public Required .false.), val: (Variable 7 val In () () Default (Logical 4 []) Source Public Required .false.)}) new_string_from_logical_lk [(Var 7 val)] [] [] (Var 7 new) Source Public Interface () .true. .false. .false. .false.), string_type: (DerivedType (SymbolTable 3 {raw: (Variable 3 raw Local () () Allocatable (Character 1 -2 () []) Source Public Required .false.)}) string_type [raw] Source Public ()), ~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)}) stdlib_string_type [] .false. .false.), stdlib_string_type_constructor: (Module (SymbolTable 8 {new_string: (Function (SymbolTable 9 {new: (Variable 9 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), string: (Variable 9 string In () () Default (Character 1 -1 () []) Source Public Optional .false.)}) new_string [(Var 9 string)] [] [] (Var 9 new) Source Public Implementation () .true. .false. .false. .false.), new_string_from_integer_int32: (Function (SymbolTable 10 {new: (Variable 10 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 10 val In () () Default (Integer 4 []) Source Public Required .false.)}) new_string_from_integer_int32 [(Var 10 val)] [] [] (Var 10 new) Source Public Implementation () .true. .false. .false. .false.), new_string_from_integer_int64: (Function (SymbolTable 11 {new: (Variable 11 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 11 val In () () Default (Integer 8 []) Source Public Required .false.)}) new_string_from_integer_int64 [(Var 11 val)] [] [] (Var 11 new) Source Public Implementation () .true. .false. .false. .false.), new_string_from_logical_lk: (Function (SymbolTable 12 {new: (Variable 12 new ReturnVar () () Default (Derived 8 string_type []) Source Public Required .false.), val: (Variable 12 val In () () Default (Logical 4 []) Source Public Required .false.)}) new_string_from_logical_lk [(Var 12 val)] [] [] (Var 12 new) Source Public Implementation () .true. .false. .false. .false.), string_type: (ExternalSymbol 8 string_type 2 string_type stdlib_string_type [] string_type Public), ~string_type: (ExternalSymbol 8 ~string_type 2 ~string_type stdlib_string_type [] ~string_type Public)}) stdlib_string_type_constructor [] .false. .false.)}) []) diff --git a/tests/reference/asr-derived_types_06-5ae916e.json b/tests/reference/asr-derived_types_06-5ae916e.json index 652b0146b0..1a435e58b9 100644 --- a/tests/reference/asr-derived_types_06-5ae916e.json +++ b/tests/reference/asr-derived_types_06-5ae916e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_06-5ae916e.stdout", - "stdout_hash": "4b9ddf936efa861e04c62a88ed2f8f7103ad6e49d54a18ac79f72552", + "stdout_hash": "b1b52f8c531cf735c99f304e2e70ce155654f2cf2f1ed1d64d78b09e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_06-5ae916e.stdout b/tests/reference/asr-derived_types_06-5ae916e.stdout index 63b7ed39ad..000d2c2b19 100644 --- a/tests/reference/asr-derived_types_06-5ae916e.stdout +++ b/tests/reference/asr-derived_types_06-5ae916e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {abstract_type: (Module (SymbolTable 2 {subrout: (Function (SymbolTable 3 {a: (Variable 3 a Out () () Default (Class 3 ~abstract_type []) Source Public Required .false.), ~abstract_type: (DerivedType (SymbolTable 4 {}) ~abstract_type [] Source Public ())}) subrout [(Var 3 a)] [] [] () Source Public Implementation () .false. .false. .false.)}) abstract_type [] .false. .false.), derived_types_01: (Program (SymbolTable 5 {}) derived_types_01 [] [])}) []) +(TranslationUnit (SymbolTable 1 {abstract_type: (Module (SymbolTable 2 {subrout: (Function (SymbolTable 3 {a: (Variable 3 a Out () () Default (Class 3 ~abstract_type []) Source Public Required .false.), ~abstract_type: (DerivedType (SymbolTable 4 {}) ~abstract_type [] Source Public ())}) subrout [(Var 3 a)] [] [] () Source Public Implementation () .false. .false. .false. .false.)}) abstract_type [] .false. .false.), derived_types_01: (Program (SymbolTable 5 {}) derived_types_01 [] [])}) []) diff --git a/tests/reference/asr-derived_types_07-ccfd81f.json b/tests/reference/asr-derived_types_07-ccfd81f.json index 85f5510cd2..d493cd4a5b 100644 --- a/tests/reference/asr-derived_types_07-ccfd81f.json +++ b/tests/reference/asr-derived_types_07-ccfd81f.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_07-ccfd81f.stdout", - "stdout_hash": "47b7eec8d31d3b8a3177340ec5c98216d9ce0ce85c83922afe7571e9", + "stdout_hash": "882bb1df8a76c40ad766c84cbc150c3657cd04964c2891c140b45b46", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_07-ccfd81f.stdout b/tests/reference/asr-derived_types_07-ccfd81f.stdout index 8ce3c1156f..72e4039874 100644 --- a/tests/reference/asr-derived_types_07-ccfd81f.stdout +++ b/tests/reference/asr-derived_types_07-ccfd81f.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {derived_types_05: (Program (SymbolTable 5 {}) derived_types_05 [] []), stdlib_logger: (Module (SymbolTable 2 {final_logger: (Function (SymbolTable 4 {iostat: (Variable 4 iostat Local () () Default (Integer 4 []) Source Private Required .false.), message: (Variable 4 message Local () () Default (Character 1 256 () []) Source Private Required .false.), self: (Variable 4 self In () () Default (Derived 2 logger_type []) Source Private Required .false.), unit: (Variable 4 unit Local () () Default (Integer 4 []) Source Private Required .false.)}) final_logger [(Var 4 self)] [] [] () Source Private Implementation () .false. .false. .false.), logger_type: (DerivedType (SymbolTable 3 {add_blank_line: (Variable 3 add_blank_line Local (LogicalConstant .false. (Logical 4 [])) () Save (Logical 4 []) Source Private Required .false.), log_units: (Variable 3 log_units Local () () Allocatable (Integer 4 [(() ())]) Source Private Required .false.), max_width: (Variable 3 max_width Local (IntegerConstant 0 (Integer 4 [])) () Save (Integer 4 []) Source Private Required .false.)}) logger_type [add_blank_line log_units max_width] Source Private ())}) stdlib_logger [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {derived_types_05: (Program (SymbolTable 5 {}) derived_types_05 [] []), stdlib_logger: (Module (SymbolTable 2 {final_logger: (Function (SymbolTable 4 {iostat: (Variable 4 iostat Local () () Default (Integer 4 []) Source Private Required .false.), message: (Variable 4 message Local () () Default (Character 1 256 () []) Source Private Required .false.), self: (Variable 4 self In () () Default (Derived 2 logger_type []) Source Private Required .false.), unit: (Variable 4 unit Local () () Default (Integer 4 []) Source Private Required .false.)}) final_logger [(Var 4 self)] [] [] () Source Private Implementation () .false. .false. .false. .false.), logger_type: (DerivedType (SymbolTable 3 {add_blank_line: (Variable 3 add_blank_line Local (LogicalConstant .false. (Logical 4 [])) () Save (Logical 4 []) Source Private Required .false.), log_units: (Variable 3 log_units Local () () Allocatable (Integer 4 [(() ())]) Source Private Required .false.), max_width: (Variable 3 max_width Local (IntegerConstant 0 (Integer 4 [])) () Save (Integer 4 []) Source Private Required .false.)}) logger_type [add_blank_line log_units max_width] Source Private ())}) stdlib_logger [] .false. .false.)}) []) diff --git a/tests/reference/asr-derived_types_08-3680946.json b/tests/reference/asr-derived_types_08-3680946.json index 8a71caa357..7254cee32f 100644 --- a/tests/reference/asr-derived_types_08-3680946.json +++ b/tests/reference/asr-derived_types_08-3680946.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-derived_types_08-3680946.stdout", - "stdout_hash": "5ae69284d033be31927ae5b09271806741b3885b26b0304de1e945b7", + "stdout_hash": "681f3bdc5201ab3df3d6fa4ca4dbc4201ae0dc5fa9cb5cd239fa6602", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-derived_types_08-3680946.stdout b/tests/reference/asr-derived_types_08-3680946.stdout index a24195e82d..9060daec27 100644 --- a/tests/reference/asr-derived_types_08-3680946.stdout +++ b/tests/reference/asr-derived_types_08-3680946.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {derived_types_08: (Program (SymbolTable 6 {initialize_subrout: (ExternalSymbol 6 initialize_subrout 2 initialize_subrout shape_mod [] initialize_subrout Public), rect: (Variable 6 rect Local () () Default (Derived 6 rectangle []) Source Public Required .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 (Derived 6 shape []) Source Public Required .false.)}) derived_types_08 [shape_mod] [(SubroutineCall 3 initialize () [((IntegerConstant 1 (Integer 4 []))) ((LogicalConstant .true. (Logical 4 []))) ((IntegerConstant 10 (Integer 4 []))) ((IntegerConstant 20 (Integer 4 [])))] (Var 6 shp)) (SubroutineCall 3 initialize () [((IntegerConstant 2 (Integer 4 []))) ((LogicalConstant .false. (Logical 4 []))) ((IntegerConstant 100 (Integer 4 []))) ((IntegerConstant 200 (Integer 4 [])))] (Var 6 rect)) (Print () [(DerivedRef (Var 6 shp) 3 color (Integer 4 []) ()) (DerivedRef (Var 6 shp) 3 filled (Logical 4 []) ()) (DerivedRef (Var 6 shp) 3 x (Integer 4 []) ()) (DerivedRef (Var 6 shp) 3 y (Integer 4 []) ())] () ()) (Print () [(DerivedRef (Var 6 rect) 3 color (Integer 4 []) ()) (DerivedRef (Var 6 rect) 3 filled (Logical 4 []) ()) (DerivedRef (Var 6 rect) 3 x (Integer 4 []) ()) (DerivedRef (Var 6 rect) 3 y (Integer 4 []) ())] () ()) (= (DerivedRef (Var 6 rect) 4 length (Integer 4 []) ()) (IntegerConstant 100 (Integer 4 [])) ()) (= (DerivedRef (Var 6 rect) 4 width (Integer 4 []) ()) (IntegerConstant 200 (Integer 4 [])) ()) (Print () [(DerivedRef (Var 6 rect) 4 length (Integer 4 []) ()) (DerivedRef (Var 6 rect) 4 width (Integer 4 []) ())] () ())]), shape_mod: (Module (SymbolTable 2 {initialize_subrout: (Function (SymbolTable 5 {color: (Variable 5 color Unspecified () () Default (Integer 4 []) Source Public Required .false.), filled: (Variable 5 filled Unspecified () () Default (Logical 4 []) Source Public Required .false.), sh: (Variable 5 sh Unspecified () () Default (Class 2 shape []) Source Public Required .false.), x: (Variable 5 x Unspecified () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 5 y Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) initialize_subrout [(Var 5 sh) (Var 5 color) (Var 5 filled) (Var 5 x) (Var 5 y)] [] [(= (DerivedRef (Var 5 sh) 3 color (Integer 4 []) ()) (Var 5 color) ()) (= (DerivedRef (Var 5 sh) 3 filled (Logical 4 []) ()) (Var 5 filled) ()) (= (DerivedRef (Var 5 sh) 3 x (Integer 4 []) ()) (Var 5 x) ()) (= (DerivedRef (Var 5 sh) 3 y (Integer 4 []) ()) (Var 5 y) ())] () Source Public Implementation () .false. .false. .false.), rectangle: (DerivedType (SymbolTable 4 {length: (Variable 4 length Local () () Default (Integer 4 []) Source Public Required .false.), width: (Variable 4 width Local () () Default (Integer 4 []) Source Public Required .false.)}) rectangle [length width] Source Public 2 shape), shape: (DerivedType (SymbolTable 3 {color: (Variable 3 color Local () () Default (Integer 4 []) Source Public Required .false.), filled: (Variable 3 filled Local () () Default (Logical 4 []) Source Public Required .false.), initialize: (ClassProcedure 3 initialize initialize_subrout 2 initialize_subrout Source), x: (Variable 3 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Integer 4 []) Source Public Required .false.)}) shape [color filled x y] Source Public ())}) shape_mod [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {derived_types_08: (Program (SymbolTable 6 {initialize_subrout: (ExternalSymbol 6 initialize_subrout 2 initialize_subrout shape_mod [] initialize_subrout Public), rect: (Variable 6 rect Local () () Default (Derived 6 rectangle []) Source Public Required .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 (Derived 6 shape []) Source Public Required .false.)}) derived_types_08 [shape_mod] [(SubroutineCall 3 initialize () [((IntegerConstant 1 (Integer 4 []))) ((LogicalConstant .true. (Logical 4 []))) ((IntegerConstant 10 (Integer 4 []))) ((IntegerConstant 20 (Integer 4 [])))] (Var 6 shp)) (SubroutineCall 3 initialize () [((IntegerConstant 2 (Integer 4 []))) ((LogicalConstant .false. (Logical 4 []))) ((IntegerConstant 100 (Integer 4 []))) ((IntegerConstant 200 (Integer 4 [])))] (Var 6 rect)) (Print () [(DerivedRef (Var 6 shp) 3 color (Integer 4 []) ()) (DerivedRef (Var 6 shp) 3 filled (Logical 4 []) ()) (DerivedRef (Var 6 shp) 3 x (Integer 4 []) ()) (DerivedRef (Var 6 shp) 3 y (Integer 4 []) ())] () ()) (Print () [(DerivedRef (Var 6 rect) 3 color (Integer 4 []) ()) (DerivedRef (Var 6 rect) 3 filled (Logical 4 []) ()) (DerivedRef (Var 6 rect) 3 x (Integer 4 []) ()) (DerivedRef (Var 6 rect) 3 y (Integer 4 []) ())] () ()) (= (DerivedRef (Var 6 rect) 4 length (Integer 4 []) ()) (IntegerConstant 100 (Integer 4 [])) ()) (= (DerivedRef (Var 6 rect) 4 width (Integer 4 []) ()) (IntegerConstant 200 (Integer 4 [])) ()) (Print () [(DerivedRef (Var 6 rect) 4 length (Integer 4 []) ()) (DerivedRef (Var 6 rect) 4 width (Integer 4 []) ())] () ())]), shape_mod: (Module (SymbolTable 2 {initialize_subrout: (Function (SymbolTable 5 {color: (Variable 5 color Unspecified () () Default (Integer 4 []) Source Public Required .false.), filled: (Variable 5 filled Unspecified () () Default (Logical 4 []) Source Public Required .false.), sh: (Variable 5 sh Unspecified () () Default (Class 2 shape []) Source Public Required .false.), x: (Variable 5 x Unspecified () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 5 y Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) initialize_subrout [(Var 5 sh) (Var 5 color) (Var 5 filled) (Var 5 x) (Var 5 y)] [] [(= (DerivedRef (Var 5 sh) 3 color (Integer 4 []) ()) (Var 5 color) ()) (= (DerivedRef (Var 5 sh) 3 filled (Logical 4 []) ()) (Var 5 filled) ()) (= (DerivedRef (Var 5 sh) 3 x (Integer 4 []) ()) (Var 5 x) ()) (= (DerivedRef (Var 5 sh) 3 y (Integer 4 []) ()) (Var 5 y) ())] () Source Public Implementation () .false. .false. .false. .false.), rectangle: (DerivedType (SymbolTable 4 {length: (Variable 4 length Local () () Default (Integer 4 []) Source Public Required .false.), width: (Variable 4 width Local () () Default (Integer 4 []) Source Public Required .false.)}) rectangle [length width] Source Public 2 shape), shape: (DerivedType (SymbolTable 3 {color: (Variable 3 color Local () () Default (Integer 4 []) Source Public Required .false.), filled: (Variable 3 filled Local () () Default (Logical 4 []) Source Public Required .false.), initialize: (ClassProcedure 3 initialize initialize_subrout 2 initialize_subrout Source), x: (Variable 3 x Local () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Integer 4 []) Source Public Required .false.)}) shape [color filled x y] Source Public ())}) shape_mod [] .false. .false.)}) []) diff --git a/tests/reference/asr-dimension_attr-1c00ad6.json b/tests/reference/asr-dimension_attr-1c00ad6.json index cc7935acfd..437228a641 100644 --- a/tests/reference/asr-dimension_attr-1c00ad6.json +++ b/tests/reference/asr-dimension_attr-1c00ad6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-dimension_attr-1c00ad6.stdout", - "stdout_hash": "bd84cd967c0f69b657681d2a9d982842818baa1fc6804f7e4e85330e", + "stdout_hash": "1252d65c80103e28b5b973039a8068927051a89ae662087b52653ca3", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-dimension_attr-1c00ad6.stdout b/tests/reference/asr-dimension_attr-1c00ad6.stdout index 2147b95134..3da1e390db 100644 --- a/tests/reference/asr-dimension_attr-1c00ad6.stdout +++ b/tests/reference/asr-dimension_attr-1c00ad6.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) f [(Var 2 a)] [] [(Print () [(Var 2 a)] () ())] () Source Public Implementation () .false. .false. .false.), main: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 3 d Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), z: (Variable 3 z Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) main [] [(SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4 [])))] ())])}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) f [(Var 2 a)] [] [(Print () [(Var 2 a)] () ())] () Source Public Implementation () .false. .false. .false. .false.), main: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10 (Integer 4 [])))]) Source Public Required .false.), d: (Variable 3 d Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 [])))]) Source Public Required .false.), z: (Variable 3 z Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) main [] [(SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4 [])))] ())])}) []) diff --git a/tests/reference/asr-dimension_attr2-8fda690.json b/tests/reference/asr-dimension_attr2-8fda690.json index d382b23094..57bc6ae7ae 100644 --- a/tests/reference/asr-dimension_attr2-8fda690.json +++ b/tests/reference/asr-dimension_attr2-8fda690.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-dimension_attr2-8fda690.stdout", - "stdout_hash": "8cca1169a698173c242b06842c26ea09b65e763bca03e808dc98aba8", + "stdout_hash": "e127ec5a1a1f826fb9afa137687dbc891da41beeeb5348e8dd0282e9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-dimension_attr2-8fda690.stdout b/tests/reference/asr-dimension_attr2-8fda690.stdout index 5f99b65495..0f0a827dac 100644 --- a/tests/reference/asr-dimension_attr2-8fda690.stdout +++ b/tests/reference/asr-dimension_attr2-8fda690.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Unspecified () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) f [(Var 2 x)] [] [] (Var 2 f) Source Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f: (Variable 2 f ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Unspecified () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), y: (Variable 2 y Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) f [(Var 2 x)] [] [] (Var 2 f) Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-fixed_form_call1-48907cd.json b/tests/reference/asr-fixed_form_call1-48907cd.json new file mode 100644 index 0000000000..c42d945281 --- /dev/null +++ b/tests/reference/asr-fixed_form_call1-48907cd.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-fixed_form_call1-48907cd", + "cmd": "lfortran --fixed-form --allow-implicit-interface --show-asr --no-color {infile} -o {outfile}", + "infile": "tests/fixed_form_call1.f", + "infile_hash": "cb6674a06b92dda41650f02e8f066e0e23bc067d3d89161c62dfb256", + "outfile": null, + "outfile_hash": null, + "stdout": "asr-fixed_form_call1-48907cd.stdout", + "stdout_hash": "144d283d232dd048f544169f76e8fe8c0cc1e63fb46ae1382d46b75b", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_call1-48907cd.stdout b/tests/reference/asr-fixed_form_call1-48907cd.stdout new file mode 100644 index 0000000000..980c833847 --- /dev/null +++ b/tests/reference/asr-fixed_form_call1-48907cd.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {idd_frm: (Function (SymbolTable 2 {lw: (Variable 2 lw Local () () Default (Integer 4 []) Source Public Required .false.), m: (Variable 2 m Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), prinf: (Function (SymbolTable 3 {prinf_arg_0: (Variable 3 prinf_arg_0 Unspecified () () Default (Character 1 6 () []) Source Public Required .false.), prinf_arg_1: (Variable 3 prinf_arg_1 Unspecified () () Default (Integer 4 []) Source Public Required .false.), prinf_arg_2: (Variable 3 prinf_arg_2 Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) prinf [(Var 3 prinf_arg_0) (Var 3 prinf_arg_1) (Var 3 prinf_arg_2)] [] [] () Source Public Interface () .false. .false. .false. .false.), w: (Variable 2 w Unspecified () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Unspecified () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) idd_frm [(Var 2 m) (Var 2 n) (Var 2 w) (Var 2 x) (Var 2 y)] [] [(SubroutineCall 2 prinf () [((StringConstant "lw = *" (Character 1 6 () []))) ((Var 2 lw)) ((IntegerConstant 1 (Integer 4 [])))] ()) (SubroutineCall 2 prinf () [((StringConstant "16m+70 = *" (Character 1 10 () []))) ((IntegerBinOp (IntegerBinOp (IntegerConstant 16 (Integer 4 [])) Mul (Var 2 m) (Integer 4 []) ()) Add (IntegerConstant 70 (Integer 4 [])) (Integer 4 []) ())) ((IntegerConstant 1 (Integer 4 [])))] ()) (Return)] () Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-fixed_form_call2-b5a167e.json b/tests/reference/asr-fixed_form_call2-b5a167e.json new file mode 100644 index 0000000000..bc7f2ff9b1 --- /dev/null +++ b/tests/reference/asr-fixed_form_call2-b5a167e.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-fixed_form_call2-b5a167e", + "cmd": "lfortran --fixed-form --allow-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-b5a167e.stdout", + "stdout_hash": "6cd53d0894b5a34faf0f3d458380974923020c56801672c195df62ba", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_call2-b5a167e.stdout b/tests/reference/asr-fixed_form_call2-b5a167e.stdout new file mode 100644 index 0000000000..75e4ebcc03 --- /dev/null +++ b/tests/reference/asr-fixed_form_call2-b5a167e.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {idd_frm: (Function (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 []) Source Public Required .false.), m: (Variable 2 m Unspecified () () Default (Integer 4 []) Source Public Required .false.), prinf: (Function (SymbolTable 3 {prinf_arg_0: (Variable 3 prinf_arg_0 Unspecified () () Default (Character 1 6 () []) Source Public Required .false.), prinf_arg_1: (Variable 3 prinf_arg_1 Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) prinf [(Var 3 prinf_arg_0) (Var 3 prinf_arg_1)] [] [] () Source Public Interface () .false. .false. .false. .false.)}) idd_frm [(Var 2 m)] [] [(= (Var 2 a) (IntegerConstant 2 (Integer 4 [])) ()) (SubroutineCall 2 prinf () [((StringConstant "lw = *" (Character 1 6 () []))) ((IntegerConstant 1 (Integer 4 [])))] ()) (SubroutineCall 2 prinf () [((StringConstant "16m+70 = *" (Character 1 10 () []))) ((IntegerConstant 1 (Integer 4 [])))] ()) (= (Var 2 m) (IntegerConstant 1 (Integer 4 [])) ()) (Return)] () Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-fixed_form_call3-d5778bd.json b/tests/reference/asr-fixed_form_call3-d5778bd.json new file mode 100644 index 0000000000..5cc549d0c9 --- /dev/null +++ b/tests/reference/asr-fixed_form_call3-d5778bd.json @@ -0,0 +1,13 @@ +{ + "basename": "asr-fixed_form_call3-d5778bd", + "cmd": "lfortran --fixed-form --allow-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-d5778bd.stderr", + "stderr_hash": "ab1a497605476706e39b3a5cf0f850464574fd18ca9b34c4e74c999b", + "returncode": 2 +} \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_call3-d5778bd.stderr b/tests/reference/asr-fixed_form_call3-d5778bd.stderr new file mode 100644 index 0000000000..8ebb409c93 --- /dev/null +++ b/tests/reference/asr-fixed_form_call3-d5778bd.stderr @@ -0,0 +1,5 @@ +syntax error: Token ')' is unexpected here + --> tests/fixed_form_call3.f:5:43 + | +5 | call prinf('16m+70 = *',16*m+70,1)) + | ^ diff --git a/tests/reference/asr-fixed_form_goto_select-a0c3483.json b/tests/reference/asr-fixed_form_goto_select-a0c3483.json new file mode 100644 index 0000000000..07fa0cada7 --- /dev/null +++ b/tests/reference/asr-fixed_form_goto_select-a0c3483.json @@ -0,0 +1,13 @@ +{ + "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": "85be626ff6aa91b2ff7b235d0a6be734ecd1cbf546dc276594bf4cac", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_goto_select-a0c3483.stdout b/tests/reference/asr-fixed_form_goto_select-a0c3483.stdout new file mode 100644 index 0000000000..e576f13d33 --- /dev/null +++ b/tests/reference/asr-fixed_form_goto_select-a0c3483.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {main: (Program (SymbolTable 2 {k: (Variable 2 k Local () () Default (Integer 4 []) Source Public Required .false.), m: (Variable 2 m Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Local () () Default (Integer 4 []) Source Public Required .false.)}) main [] [(= (Var 2 k) (IntegerConstant 1 (Integer 4 [])) ()) (GoToTarget 100) (Print () [(StringConstant "hello" (Character 1 5 () []))] () ()) (GoToTarget 200) (= (Var 2 k) (IntegerBinOp (Var 2 k) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 2 m) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 n) (IntegerConstant 2 (Integer 4 [])) ()) (Select (Var 2 m) [(CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(GoTo 200)]) (CaseStmt [(IntegerConstant 2 (Integer 4 []))] [(GoTo 100)])] []) (Select (Var 2 n) [(CaseStmt [(IntegerConstant 1 (Integer 4 []))] [(GoTo 100)]) (CaseStmt [(IntegerConstant 2 (Integer 4 []))] [(GoTo 200)])] [])])}) []) diff --git a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json index 062f5b962f..14ee77f867 100644 --- a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json +++ b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-fixed_form_if_variations-b4dcd1e.stdout", - "stdout_hash": "3da1975a13d60a80bbc681a903f5672d9cbdbc9ac7918398a1780839", + "stdout_hash": "ee343915bbe4e3b3173e69070036bd38d49e1f8f71e11a187fca752f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stdout b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stdout index a52a8acaeb..5940982e46 100644 --- a/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stdout +++ b/tests/reference/asr-fixed_form_if_variations-b4dcd1e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) f [(Var 2 a)] [] [(Print () [(Var 2 a)] () ())] () Source Public Implementation () .false. .false. .false.), main: (Program (SymbolTable 3 {}) main [] [(If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(Print () [(StringConstant "first branch" (Character 1 12 () []))] () ())] [(Print () [(StringConstant "second branch" (Character 1 13 () []))] () ())]) (GoToTarget 50) (SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4 [])))] ()) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(Return)] []) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Gt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) [(GoTo 50)] []) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(SubroutineCall 1 f () [((IntegerConstant 2 (Integer 4 [])))] ())] [])])}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Unspecified () () Default (Integer 4 []) Source Public Required .false.)}) f [(Var 2 a)] [] [(Print () [(Var 2 a)] () ())] () Source Public Implementation () .false. .false. .false. .false.), main: (Program (SymbolTable 3 {}) main [] [(If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(Print () [(StringConstant "first branch" (Character 1 12 () []))] () ())] [(Print () [(StringConstant "second branch" (Character 1 13 () []))] () ())]) (GoToTarget 50) (SubroutineCall 1 f () [((IntegerConstant 1 (Integer 4 [])))] ()) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 2 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(Return)] []) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Gt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) [(GoTo 50)] []) (If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Lt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .true. (Logical 4 []))) [(SubroutineCall 1 f () [((IntegerConstant 2 (Integer 4 [])))] ())] [])])}) []) diff --git a/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json new file mode 100644 index 0000000000..8adaae9203 --- /dev/null +++ b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.json @@ -0,0 +1,13 @@ +{ + "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": "3053ee09aedbc26b3d2babb181ee5dca87e77a41116f20293d534f58", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stdout b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stdout new file mode 100644 index 0000000000..dc53d54847 --- /dev/null +++ b/tests/reference/asr-fixed_form_simple_continue-1cd55c6.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {implicit_program_lfortran: (Program (SymbolTable 2 {}) implicit_program_lfortran [] [])}) []) diff --git a/tests/reference/asr-flip_sign-a0cebd4.json b/tests/reference/asr-flip_sign-a0cebd4.json index aeb771015c..4314dd4801 100644 --- a/tests/reference/asr-flip_sign-a0cebd4.json +++ b/tests/reference/asr-flip_sign-a0cebd4.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-flip_sign-a0cebd4.stdout", - "stdout_hash": "f8ca1516a812d4c01d0e729e4b8fce0f69f5dccee8556c0809bae861", + "stdout_hash": "5d19ed950f020a87a2502896687158653411823f4c8d93161e34c32c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-flip_sign-a0cebd4.stdout b/tests/reference/asr-flip_sign-a0cebd4.stdout index 6fcb32449d..5092c5160b 100644 --- a/tests/reference/asr-flip_sign-a0cebd4.stdout +++ b/tests/reference/asr-flip_sign-a0cebd4.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 92 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 92 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) +(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 95 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 95 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (If (IntegerCompare (FunctionCall 2 modulo@imodulo 2 modulo [((Var 2 number)) ((IntegerConstant 2 (Integer 4 [])))] (Integer 4 []) () ()) Eq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 2 x) (RealUnaryMinus (Var 2 x) (Real 4 []) ()) ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-fn2-b585098.json b/tests/reference/asr-fn2-b585098.json index f69c47977a..00ede28d56 100644 --- a/tests/reference/asr-fn2-b585098.json +++ b/tests/reference/asr-fn2-b585098.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-fn2-b585098.stdout", - "stdout_hash": "cc309eec2ffc958db5b49b556533ca7a25731586a5ce184a575334a6", + "stdout_hash": "22aa601e32656d600144ff097803f2414577cb0e4e60463d36d187ff", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-fn2-b585098.stdout b/tests/reference/asr-fn2-b585098.stdout index 3d4ef3a5c0..45b77c4432 100644 --- a/tests/reference/asr-fn2-b585098.stdout +++ b/tests/reference/asr-fn2-b585098.stdout @@ -1 +1 @@ -(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.), b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) b [] [] [] (Var 3 b) Source Public Implementation () .false. .false. .false.), c: (Function (SymbolTable 4 {c: (Variable 4 c ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) c [] [] [] (Var 4 c) Source Public Implementation () .false. .false. .false.), d: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) d [] [] [] (Var 5 r) Source Public Implementation () .false. .false. .false.), e: (Function (SymbolTable 6 {r: (Variable 6 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) e [] [] [] (Var 6 r) Source Public Implementation () .false. .false. .false.), f: (Function (SymbolTable 7 {r: (Variable 7 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) f [] [] [] (Var 7 r) Source Public Implementation () .false. .false. .false.)}) []) +(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.), b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) b [] [] [] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.), c: (Function (SymbolTable 4 {c: (Variable 4 c ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) c [] [] [] (Var 4 c) Source Public Implementation () .false. .false. .false. .false.), d: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) d [] [] [] (Var 5 r) Source Public Implementation () .false. .false. .false. .false.), e: (Function (SymbolTable 6 {r: (Variable 6 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) e [] [] [] (Var 6 r) Source Public Implementation () .false. .false. .false. .false.), f: (Function (SymbolTable 7 {r: (Variable 7 r ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) f [] [] [] (Var 7 r) Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-functions_04-ea50b75.json b/tests/reference/asr-functions_04-ea50b75.json index 2decd4fcd1..0cf0cfd607 100644 --- a/tests/reference/asr-functions_04-ea50b75.json +++ b/tests/reference/asr-functions_04-ea50b75.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_04-ea50b75.stdout", - "stdout_hash": "b8fe67bccdad1ff38b81c7d36289fcc08057de1b0a14e12710df32d3", + "stdout_hash": "f100d700771bc083234b3292019048ac2780aac1f9d8a24da7ad0c14", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_04-ea50b75.stdout b/tests/reference/asr-functions_04-ea50b75.stdout index 184e398d21..bad2b24114 100644 --- a/tests/reference/asr-functions_04-ea50b75.stdout +++ b/tests/reference/asr-functions_04-ea50b75.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {functions_04: (Program (SymbolTable 4 {int: (Variable 4 int Local (IntegerConstant 4 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .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 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 4 int) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) ()) (If (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4 []) () ()) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (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.), neg_int: (Variable 3 neg_int ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) to_negative~genericprocedure [(Var 3 int)] [] [(If (IntegerCompare (Var 3 int) GtE (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 3 neg_int) (IntegerUnaryMinus (Var 3 int) (Integer 4 []) ()) ())] [(= (Var 3 neg_int) (Var 3 int) ())])] (Var 3 neg_int) Source Public Implementation () .false. .false. .false.)}) stdlib_int [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {functions_04: (Program (SymbolTable 4 {int: (Variable 4 int Local (IntegerConstant 4 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .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 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 4 int) (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) ()) (If (IntegerCompare (FunctionCall 4 to_negative@to_negative~genericprocedure 4 to_negative [((Var 4 int))] (Integer 4 []) () ()) NotEq (IntegerUnaryMinus (IntegerConstant 4 (Integer 4 [])) (Integer 4 []) (IntegerConstant -4 (Integer 4 []))) (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.), neg_int: (Variable 3 neg_int ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) to_negative~genericprocedure [(Var 3 int)] [] [(If (IntegerCompare (Var 3 int) GtE (IntegerConstant 0 (Integer 4 [])) (Logical 4 []) ()) [(= (Var 3 neg_int) (IntegerUnaryMinus (Var 3 int) (Integer 4 []) ()) ())] [(= (Var 3 neg_int) (Var 3 int) ())])] (Var 3 neg_int) Source Public Implementation () .false. .false. .false. .false.)}) stdlib_int [] .false. .false.)}) []) diff --git a/tests/reference/asr-functions_05-adf0d8b.json b/tests/reference/asr-functions_05-adf0d8b.json index e5a25055b8..0bca599589 100644 --- a/tests/reference/asr-functions_05-adf0d8b.json +++ b/tests/reference/asr-functions_05-adf0d8b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_05-adf0d8b.stdout", - "stdout_hash": "3ddb916043c2b899eb631cf86281af02c7d4a5587d1069e854abb830", + "stdout_hash": "893960ba8e820ca7531f3dfae8a44ee9ec90b5f149a8f55d5e37f6bb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_05-adf0d8b.stdout b/tests/reference/asr-functions_05-adf0d8b.stdout index 8995349665..2acf6d5882 100644 --- a/tests/reference/asr-functions_05-adf0d8b.stdout +++ b/tests/reference/asr-functions_05-adf0d8b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {functions_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) f [(Var 3 a)] [] [(= (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4 []) ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.), f_real: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 4 a)] [] [(= (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 2 signr32 () [((RealConstant 1.000000 (Real 4 []))) ((Var 4 a))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false.), p: (Variable 2 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 2 q Local () () Default (Real 4 []) Source Public Required .false.), signr32: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y In () () Default (Real 4 []) Source Public Required .false.)}) signr32 [(Var 5 x) (Var 5 y)] [] [(= (Var 5 r) (Var 5 x) ()) (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 []) ()) [(= (Var 5 r) (Var 5 x) ())] [(= (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4 []) ()) ())])] (Var 5 r) Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local (IntegerConstant 5 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 2 y) (FunctionCall 2 f () [((Var 2 x))] (Integer 4 []) () ()) ()) (Print () [(Var 2 y)] () ()) (= (Var 2 q) (FunctionCall 2 f_real () [((Var 2 p))] (Real 4 []) () ()) ()) (Print () [(Var 2 q)] () ()) (= (Var 2 a) (RealConstant 20.000000 (Real 4 [])) ()) (= (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4 [])) (Real 4 []) (RealConstant -30.000000 (Real 4 []))) ()) (= (Var 2 c) (FunctionCall 2 signr32 () [((Var 2 a)) ((Var 2 b))] (Real 4 []) () ()) ()) (Print () [(Var 2 c)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {functions_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) f [(Var 3 a)] [] [(= (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4 []) ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.), f_real: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 4 a)] [] [(= (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 2 signr32 () [((RealConstant 1.000000 (Real 4 []))) ((Var 4 a))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false. .false.), p: (Variable 2 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 2 q Local () () Default (Real 4 []) Source Public Required .false.), signr32: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y In () () Default (Real 4 []) Source Public Required .false.)}) signr32 [(Var 5 x) (Var 5 y)] [] [(= (Var 5 r) (Var 5 x) ()) (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 []) ()) [(= (Var 5 r) (Var 5 x) ())] [(= (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4 []) ()) ())])] (Var 5 r) Source Public Implementation () .false. .false. .false. .false.), x: (Variable 2 x Local (IntegerConstant 5 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 2 y) (FunctionCall 2 f () [((Var 2 x))] (Integer 4 []) () ()) ()) (Print () [(Var 2 y)] () ()) (= (Var 2 q) (FunctionCall 2 f_real () [((Var 2 p))] (Real 4 []) () ()) ()) (Print () [(Var 2 q)] () ()) (= (Var 2 a) (RealConstant 20.000000 (Real 4 [])) ()) (= (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4 [])) (Real 4 []) (RealConstant -30.000000 (Real 4 []))) ()) (= (Var 2 c) (FunctionCall 2 signr32 () [((Var 2 a)) ((Var 2 b))] (Real 4 []) () ()) ()) (Print () [(Var 2 c)] () ())])}) []) diff --git a/tests/reference/asr-functions_06-83a7aca.json b/tests/reference/asr-functions_06-83a7aca.json index 442dc8e982..4e0f3ecf8c 100644 --- a/tests/reference/asr-functions_06-83a7aca.json +++ b/tests/reference/asr-functions_06-83a7aca.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_06-83a7aca.stdout", - "stdout_hash": "c9ca90b74522400b4f3d1bc0b01036cbc8e847353a8f6f06e6054125", + "stdout_hash": "004327c42d05d9d3e3e56b907c9470264549db762fa4f49ccd5000d9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_06-83a7aca.stdout b/tests/reference/asr-functions_06-83a7aca.stdout index 19f5824bac..b1848fcd2f 100644 --- a/tests/reference/asr-functions_06-83a7aca.stdout +++ b/tests/reference/asr-functions_06-83a7aca.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {int_return: (Function (SymbolTable 4 {i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 4 len 6 len lfortran_intrinsic_builtin [] len Private), r: (Variable 4 r ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 4 len () [((Var 4 s))] (Integer 4 []) () ()))]) Source Public Required .false.), s: (Variable 4 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.)}) int_return [(Var 4 s)] [] [(DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (FunctionCall 4 len () [((Var 4 s))] (Integer 4 []) () ()) ()) [(= (ArrayItem (Var 4 r) [(() (Var 4 i) ())] (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false.), real_return: (Function (SymbolTable 29 {i: (Variable 29 i Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 29 len 6 len lfortran_intrinsic_builtin [] len Private), r: (Variable 29 r ReturnVar () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 29 len () [((Var 29 s))] (Integer 4 []) () ()))]) Source Public Required .false.), s: (Variable 29 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.)}) real_return [(Var 29 s)] [] [(DoLoop ((Var 29 i) (IntegerConstant 1 (Integer 4 [])) (FunctionCall 29 len () [((Var 29 s))] (Integer 4 []) () ()) ()) [(= (ArrayItem (Var 29 r) [(() (Var 29 i) ())] (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ())])] (Var 29 r) Source Public Implementation () .false. .false. .false.), trim_wrapper: (Function (SymbolTable 3 {len: (ExternalSymbol 3 len 6 len lfortran_intrinsic_builtin [] len Private), len_trim: (ExternalSymbol 3 len_trim 32 len_trim lfortran_intrinsic_string [] len_trim Private), r: (Variable 3 r ReturnVar () () Default (Character 1 -3 (FunctionCall 3 len () [((Var 3 s))] (Integer 4 []) () ()) []) Source Public Required .false.), s: (Variable 3 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.), trim: (ExternalSymbol 3 trim 32 trim lfortran_intrinsic_string [] trim Private)}) trim_wrapper [(Var 3 s)] [] [(= (Var 3 r) (FunctionCall 3 trim () [((Var 3 s))] (Character 1 -3 (FunctionCall 3 len_trim () [((Var 3 s))] (Integer 4 []) () ()) []) () ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) a [lfortran_intrinsic_builtin lfortran_intrinsic_string] .false. .false.), functions_06: (Program (SymbolTable 30 {int_return: (ExternalSymbol 30 int_return 2 int_return a [] int_return Public), len: (ExternalSymbol 30 len 6 len lfortran_intrinsic_builtin [] len Private), real_return: (ExternalSymbol 30 real_return 2 real_return a [] real_return Public), string: (Variable 30 string Local (StringConstant " abc" (Character 1 5 () [])) () Save (Character 1 5 () []) Source Public Required .false.), trim_wrapper: (ExternalSymbol 30 trim_wrapper 2 trim_wrapper a [] trim_wrapper Public)}) functions_06 [a] [(Print () [(FunctionCall 30 trim_wrapper () [((Var 30 string))] (Character 1 -3 (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()) []) () ())] () ()) (Print () [(FunctionCall 30 int_return () [((Var 30 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()))]) () ())] () ()) (Print () [(FunctionCall 30 real_return () [((Var 30 string))] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()))]) () ())] () ())]), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_string: (IntrinsicModule lfortran_intrinsic_string)}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {int_return: (Function (SymbolTable 4 {i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 4 len 6 len lfortran_intrinsic_builtin [] len Private), r: (Variable 4 r ReturnVar () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 4 len () [((Var 4 s))] (Integer 4 []) () ()))]) Source Public Required .false.), s: (Variable 4 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.)}) int_return [(Var 4 s)] [] [(DoLoop ((Var 4 i) (IntegerConstant 1 (Integer 4 [])) (FunctionCall 4 len () [((Var 4 s))] (Integer 4 []) () ()) ()) [(= (ArrayItem (Var 4 r) [(() (Var 4 i) ())] (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ())])] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), real_return: (Function (SymbolTable 29 {i: (Variable 29 i Local () () Default (Integer 4 []) Source Public Required .false.), len: (ExternalSymbol 29 len 6 len lfortran_intrinsic_builtin [] len Private), r: (Variable 29 r ReturnVar () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 29 len () [((Var 29 s))] (Integer 4 []) () ()))]) Source Public Required .false.), s: (Variable 29 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.)}) real_return [(Var 29 s)] [] [(DoLoop ((Var 29 i) (IntegerConstant 1 (Integer 4 [])) (FunctionCall 29 len () [((Var 29 s))] (Integer 4 []) () ()) ()) [(= (ArrayItem (Var 29 r) [(() (Var 29 i) ())] (Real 4 []) ()) (RealConstant 2.000000 (Real 4 [])) ())])] (Var 29 r) Source Public Implementation () .false. .false. .false. .false.), trim_wrapper: (Function (SymbolTable 3 {len: (ExternalSymbol 3 len 6 len lfortran_intrinsic_builtin [] len Private), len_trim: (ExternalSymbol 3 len_trim 32 len_trim lfortran_intrinsic_string [] len_trim Private), r: (Variable 3 r ReturnVar () () Default (Character 1 -3 (FunctionCall 3 len () [((Var 3 s))] (Integer 4 []) () ()) []) Source Public Required .false.), s: (Variable 3 s Unspecified () () Default (Character 1 -1 () []) Source Public Required .false.), trim: (ExternalSymbol 3 trim 32 trim lfortran_intrinsic_string [] trim Private)}) trim_wrapper [(Var 3 s)] [] [(= (Var 3 r) (FunctionCall 3 trim () [((Var 3 s))] (Character 1 -3 (FunctionCall 3 len_trim () [((Var 3 s))] (Integer 4 []) () ()) []) () ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.)}) a [lfortran_intrinsic_builtin lfortran_intrinsic_string] .false. .false.), functions_06: (Program (SymbolTable 30 {int_return: (ExternalSymbol 30 int_return 2 int_return a [] int_return Public), len: (ExternalSymbol 30 len 6 len lfortran_intrinsic_builtin [] len Private), real_return: (ExternalSymbol 30 real_return 2 real_return a [] real_return Public), string: (Variable 30 string Local (StringConstant " abc" (Character 1 5 () [])) () Save (Character 1 5 () []) Source Public Required .false.), trim_wrapper: (ExternalSymbol 30 trim_wrapper 2 trim_wrapper a [] trim_wrapper Public)}) functions_06 [a] [(Print () [(FunctionCall 30 trim_wrapper () [((Var 30 string))] (Character 1 -3 (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()) []) () ())] () ()) (Print () [(FunctionCall 30 int_return () [((Var 30 string))] (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()))]) () ())] () ()) (Print () [(FunctionCall 30 real_return () [((Var 30 string))] (Real 4 [((IntegerConstant 1 (Integer 4 [])) (FunctionCall 30 len () [((Var 30 string))] (Integer 4 []) () ()))]) () ())] () ())]), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_string: (IntrinsicModule lfortran_intrinsic_string)}) []) diff --git a/tests/reference/asr-functions_07-2d29eab.json b/tests/reference/asr-functions_07-2d29eab.json index 02ffc1fb9d..0defea10c0 100644 --- a/tests/reference/asr-functions_07-2d29eab.json +++ b/tests/reference/asr-functions_07-2d29eab.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_07-2d29eab.stdout", - "stdout_hash": "bd9acf83184e47ab00702394f439081484be561e267efe4fb1c0903f", + "stdout_hash": "fa8f4c3b5fd5a43a3d8c5a9b0fd2735a3d8f130dd5a2cca93702d7d4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_07-2d29eab.stdout b/tests/reference/asr-functions_07-2d29eab.stdout index 10d3b9b5b3..f2283e49eb 100644 --- a/tests/reference/asr-functions_07-2d29eab.stdout +++ b/tests/reference/asr-functions_07-2d29eab.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {f_a: (Function (SymbolTable 3 {u: (Variable 3 u In () () Default (Real 4 []) Source Public Required .false.), v: (Variable 3 v ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_a [(Var 3 u)] [] [(= (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 3 v) Source Public Implementation () .false. .false. .false.)}) a [] .false. .false.), b: (Module (SymbolTable 4 {f_a: (ExternalSymbol 4 f_a 2 f_a a [] f_a Public), f_b: (Function (SymbolTable 5 {x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_b [(Var 5 x)] [] [(= (Var 5 y) (RealBinOp (FunctionCall 4 f_a () [((Var 5 x))] (Real 4 []) () ()) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 5 y) Source Public Implementation () .false. .false. .false.)}) b [a] .false. .false.), c: (Module (SymbolTable 6 {f_a: (ExternalSymbol 6 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 6 f_b 4 f_b b [] f_b Public), f_c: (Function (SymbolTable 7 {w: (Variable 7 w In () () Default (Real 4 []) Source Public Required .false.), z: (Variable 7 z ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_c [(Var 7 w)] [] [(= (Var 7 z) (RealBinOp (FunctionCall 6 f_b () [((Var 7 w))] (Real 4 []) () ()) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 7 z) Source Public Implementation () .false. .false. .false.)}) c [b] .false. .false.), functions_07: (Program (SymbolTable 8 {f_a: (ExternalSymbol 8 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 8 f_b 4 f_b b [] f_b Public), f_c: (ExternalSymbol 8 f_c 6 f_c c [] f_c Public), p: (Variable 8 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 8 q Local () () Default (Real 4 []) Source Public Required .false.)}) functions_07 [c] [(= (Var 8 q) (FunctionCall 8 f_c () [((Var 8 p))] (Real 4 []) () ()) ()) (Print () [(Var 8 q)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {f_a: (Function (SymbolTable 3 {u: (Variable 3 u In () () Default (Real 4 []) Source Public Required .false.), v: (Variable 3 v ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_a [(Var 3 u)] [] [(= (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 3 v) Source Public Implementation () .false. .false. .false. .false.)}) a [] .false. .false.), b: (Module (SymbolTable 4 {f_a: (ExternalSymbol 4 f_a 2 f_a a [] f_a Public), f_b: (Function (SymbolTable 5 {x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_b [(Var 5 x)] [] [(= (Var 5 y) (RealBinOp (FunctionCall 4 f_a () [((Var 5 x))] (Real 4 []) () ()) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 5 y) Source Public Implementation () .false. .false. .false. .false.)}) b [a] .false. .false.), c: (Module (SymbolTable 6 {f_a: (ExternalSymbol 6 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 6 f_b 4 f_b b [] f_b Public), f_c: (Function (SymbolTable 7 {w: (Variable 7 w In () () Default (Real 4 []) Source Public Required .false.), z: (Variable 7 z ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_c [(Var 7 w)] [] [(= (Var 7 z) (RealBinOp (FunctionCall 6 f_b () [((Var 7 w))] (Real 4 []) () ()) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 7 z) Source Public Implementation () .false. .false. .false. .false.)}) c [b] .false. .false.), functions_07: (Program (SymbolTable 8 {f_a: (ExternalSymbol 8 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 8 f_b 4 f_b b [] f_b Public), f_c: (ExternalSymbol 8 f_c 6 f_c c [] f_c Public), p: (Variable 8 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 8 q Local () () Default (Real 4 []) Source Public Required .false.)}) functions_07 [c] [(= (Var 8 q) (FunctionCall 8 f_c () [((Var 8 p))] (Real 4 []) () ()) ()) (Print () [(Var 8 q)] () ())])}) []) diff --git a/tests/reference/asr-functions_08-23f422a.json b/tests/reference/asr-functions_08-23f422a.json index 29d8431730..d52dcec67f 100644 --- a/tests/reference/asr-functions_08-23f422a.json +++ b/tests/reference/asr-functions_08-23f422a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_08-23f422a.stdout", - "stdout_hash": "48e839556de6ef4c72da2a42898721ef2ce826113c85ea2279a34601", + "stdout_hash": "24f5f1e263a00d2addd2b5e9919002d2eb65dc437178b4e995ecb723", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_08-23f422a.stdout b/tests/reference/asr-functions_08-23f422a.stdout index a71a9bc380..c0cd33ec2c 100644 --- a/tests/reference/asr-functions_08-23f422a.stdout +++ b/tests/reference/asr-functions_08-23f422a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {}) a [] .false. .false.), functions_01: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x Local (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) f [(Var 4 a)] [] [(= (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false.), f_real: (Function (SymbolTable 5 {a: (Variable 5 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 5 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 5 a)] [] [(If (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b) (RealBinOp (Var 5 a) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())])] (Var 5 b) Source Public Implementation () .false. .false. .false.), p: (Variable 3 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 3 q Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 3 x Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 3 y) (FunctionCall 3 f () [((Var 3 x))] (Real 4 []) () ()) ()) (Print () [(Var 3 y)] () ()) (= (Var 3 q) (FunctionCall 3 f_real () [((Var 3 p))] (Real 4 []) () ()) ()) (Print () [(Var 3 q)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {}) a [] .false. .false.), functions_01: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x Local (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) f [(Var 4 a)] [] [(= (Var 4 b) (RealBinOp (Var 4 a) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false. .false.), f_real: (Function (SymbolTable 5 {a: (Variable 5 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 5 b ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 5 a)] [] [(If (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b) (RealBinOp (Var 5 a) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())])] (Var 5 b) Source Public Implementation () .false. .false. .false. .false.), p: (Variable 3 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 3 q Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 3 x Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 3 y) (FunctionCall 3 f () [((Var 3 x))] (Real 4 []) () ()) ()) (Print () [(Var 3 y)] () ()) (= (Var 3 q) (FunctionCall 3 f_real () [((Var 3 p))] (Real 4 []) () ()) ()) (Print () [(Var 3 q)] () ())])}) []) diff --git a/tests/reference/asr-functions_09-1e51ac7.json b/tests/reference/asr-functions_09-1e51ac7.json index 58388734c4..36106431db 100644 --- a/tests/reference/asr-functions_09-1e51ac7.json +++ b/tests/reference/asr-functions_09-1e51ac7.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_09-1e51ac7.stdout", - "stdout_hash": "bbfb28028a05fa8a3491f00a4f3168ae0fec7ad5d6fc93450864d304", + "stdout_hash": "5f626190932b955b9f6909faac52a5a957cf7c270703d73c32e39b17", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_09-1e51ac7.stdout b/tests/reference/asr-functions_09-1e51ac7.stdout index fa186a914f..3268420d4f 100644 --- a/tests/reference/asr-functions_09-1e51ac7.stdout +++ b/tests/reference/asr-functions_09-1e51ac7.stdout @@ -1 +1 @@ -(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.), 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.)}) stdlib_quadrature_simps [] .false. .false.)}) []) +(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.), 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.)}) stdlib_quadrature_simps [] .false. .false.)}) []) diff --git a/tests/reference/asr-functions_10-0449324.json b/tests/reference/asr-functions_10-0449324.json index ca6fd1c598..1cb48a3d84 100644 --- a/tests/reference/asr-functions_10-0449324.json +++ b/tests/reference/asr-functions_10-0449324.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-functions_10-0449324.stdout", - "stdout_hash": "a99c792a0624f651d853558e66244e20adff2711cddf7a1f87a2b55b", + "stdout_hash": "4a00b765a201a54b0f37bcd79f3e08c1eda9cf569e51795f07303c6c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-functions_10-0449324.stdout b/tests/reference/asr-functions_10-0449324.stdout index 2dd7c08f74..1766c17e0c 100644 --- a/tests/reference/asr-functions_10-0449324.stdout +++ b/tests/reference/asr-functions_10-0449324.stdout @@ -1 +1 @@ -(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 (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Integer 4 [(() ())]) Source Public Required .false.), m: (Variable 3 m Unspecified () () Default (Integer 4 [(() ())]) Source Public Optional .false.), r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) mergei32 [(Var 3 a) (Var 3 b) (Var 3 m)] [] [] (Var 3 r) Source Public Implementation () .false. .false. .false.), merger32: (Function (SymbolTable 4 {a: (Variable 4 a Unspecified () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 4 b Unspecified () () Default (Real 4 [(() ())]) Source Public Required .false.), m: (Variable 4 m Unspecified () () Default (Real 4 [(() ())]) Source Public Optional .false.), r: (Variable 4 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) merger32 [(Var 4 a) (Var 4 b) (Var 4 m)] [] [] (Var 4 r) Source Public Implementation () .false. .false. .false.), merger64: (Function (SymbolTable 5 {a: (Variable 5 a Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), b: (Variable 5 b Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), m: (Variable 5 m Unspecified () () Default (Real 8 [(() ())]) Source Public Optional .false.), r: (Variable 5 r ReturnVar () () Default (Real 8 []) Source Public Required .false.)}) merger64 [(Var 5 a) (Var 5 b) (Var 5 m)] [] [] (Var 5 r) Source Public Implementation () .false. .false. .false.)}) kwarg_gp [] .false. .false.), kwarg_use: (Program (SymbolTable 6 {a1: (Variable 6 a1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), a2: (Variable 6 a2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), b1: (Variable 6 b1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), b2: (Variable 6 b2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), m1: (Variable 6 m1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), m2: (Variable 6 m2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .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 () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1)) ((Var 6 m1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1)) ((Var 6 m1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2))] (Real 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2)) ((Var 6 m2))] (Real 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2)) ((Var 6 m2))] (Real 4 []) () ())] () ())])}) []) +(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 (Integer 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Integer 4 [(() ())]) Source Public Required .false.), m: (Variable 3 m Unspecified () () Default (Integer 4 [(() ())]) Source Public Optional .false.), r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) mergei32 [(Var 3 a) (Var 3 b) (Var 3 m)] [] [] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.), merger32: (Function (SymbolTable 4 {a: (Variable 4 a Unspecified () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 4 b Unspecified () () Default (Real 4 [(() ())]) Source Public Required .false.), m: (Variable 4 m Unspecified () () Default (Real 4 [(() ())]) Source Public Optional .false.), r: (Variable 4 r ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) merger32 [(Var 4 a) (Var 4 b) (Var 4 m)] [] [] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), merger64: (Function (SymbolTable 5 {a: (Variable 5 a Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), b: (Variable 5 b Unspecified () () Default (Real 8 [(() ())]) Source Public Required .false.), m: (Variable 5 m Unspecified () () Default (Real 8 [(() ())]) Source Public Optional .false.), r: (Variable 5 r ReturnVar () () Default (Real 8 []) Source Public Required .false.)}) merger64 [(Var 5 a) (Var 5 b) (Var 5 m)] [] [] (Var 5 r) Source Public Implementation () .false. .false. .false. .false.)}) kwarg_gp [] .false. .false.), kwarg_use: (Program (SymbolTable 6 {a1: (Variable 6 a1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), a2: (Variable 6 a2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), b1: (Variable 6 b1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), b2: (Variable 6 b2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .false.), m1: (Variable 6 m1 Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), m2: (Variable 6 m2 Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 5 (Integer 4 [])))]) Source Public Required .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 () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1)) ((Var 6 m1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@mergei32 6 mergegp [((Var 6 a1)) ((Var 6 b1)) ((Var 6 m1))] (Integer 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2))] (Real 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2)) ((Var 6 m2))] (Real 4 []) () ())] () ()) (Print () [(FunctionCall 6 mergegp@merger32 6 mergegp [((Var 6 a2)) ((Var 6 b2)) ((Var 6 m2))] (Real 4 []) () ())] () ())])}) []) diff --git a/tests/reference/asr-generic_name_01-9f2fd25.json b/tests/reference/asr-generic_name_01-9f2fd25.json index 5568b2cce2..aaa0b3e258 100644 --- a/tests/reference/asr-generic_name_01-9f2fd25.json +++ b/tests/reference/asr-generic_name_01-9f2fd25.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-generic_name_01-9f2fd25.stdout", - "stdout_hash": "3430eaff93ab487e7390ab3963c9b7ad9ada717a6b038750b16c1b6a", + "stdout_hash": "ed8e533e0197cea39ce59a435b2796853adf35ce381ca7df93aa7eb5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-generic_name_01-9f2fd25.stdout b/tests/reference/asr-generic_name_01-9f2fd25.stdout index 19047c4796..6bf6f94559 100644 --- a/tests/reference/asr-generic_name_01-9f2fd25.stdout +++ b/tests/reference/asr-generic_name_01-9f2fd25.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {complex_module: (Module (SymbolTable 2 {complextype: (DerivedType (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.), integer_add_subrout: (ClassProcedure 3 integer_add_subrout integer_add_subrout 2 integer_add_subrout Source), r: (Variable 3 r Local () () Default (Real 4 []) Source Public Required .false.), real_add_subrout: (ClassProcedure 3 real_add_subrout real_add_subrout 2 real_add_subrout Source)}) complextype [r i] Source Public ()), integer_add_subrout: (Function (SymbolTable 4 {i: (Variable 4 i In () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r In () () Default (Integer 4 []) Source Public Required .false.), sum: (Variable 4 sum Out () () Default (Derived 2 complextype []) Source Public Required .false.), this: (Variable 4 this In () () Default (Class 2 complextype []) Source Public Required .false.)}) integer_add_subrout [(Var 4 this) (Var 4 r) (Var 4 i) (Var 4 sum)] [] [(Print () [(StringConstant "Calling integer_add_subrout" (Character 1 27 () []))] () ()) (= (DerivedRef (Var 4 sum) 3 r (Real 4 []) ()) (RealBinOp (DerivedRef (Var 4 this) 3 r (Real 4 []) ()) Add (Cast (Var 4 r) IntegerToReal (Real 4 []) ()) (Real 4 []) ()) ()) (= (DerivedRef (Var 4 sum) 3 i (Real 4 []) ()) (RealBinOp (DerivedRef (Var 4 this) 3 i (Real 4 []) ()) Add (Cast (Var 4 i) IntegerToReal (Real 4 []) ()) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.), real_add_subrout: (Function (SymbolTable 5 {i: (Variable 5 i In () () Default (Real 4 []) Source Public Required .false.), r: (Variable 5 r In () () Default (Real 4 []) Source Public Required .false.), sum: (Variable 5 sum Out () () Default (Derived 2 complextype []) Source Public Required .false.), this: (Variable 5 this In () () Default (Class 2 complextype []) Source Public Required .false.)}) real_add_subrout [(Var 5 this) (Var 5 r) (Var 5 i) (Var 5 sum)] [] [(Print () [(StringConstant "Calling real_add_subrout" (Character 1 24 () []))] () ()) (= (DerivedRef (Var 5 sum) 3 r (Real 4 []) ()) (RealBinOp (DerivedRef (Var 5 this) 3 r (Real 4 []) ()) Add (Var 5 r) (Real 4 []) ()) ()) (= (DerivedRef (Var 5 sum) 3 i (Real 4 []) ()) (RealBinOp (DerivedRef (Var 5 this) 3 i (Real 4 []) ()) Add (Var 5 i) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.)}) complex_module [] .false. .false.), generic_name_01: (Program (SymbolTable 6 {a: (Variable 6 a Local () () Default (Derived 6 complextype []) Source Public Required .false.), c: (Variable 6 c Local () () Default (Derived 6 complextype []) Source Public Required .false.), complextype: (ExternalSymbol 6 complextype 2 complextype complex_module [] complextype Public), fpone: (Variable 6 fpone Local () () Default (Real 4 []) Source Public Required .false.), fptwo: (Variable 6 fptwo Local () () Default (Real 4 []) Source Public Required .false.), fpzero: (Variable 6 fpzero Local () () Default (Real 4 []) Source Public Required .false.), ione: (Variable 6 ione Local () () Default (Integer 4 []) Source Public Required .false.), izero: (Variable 6 izero Local () () Default (Integer 4 []) Source Public Required .false.), negfpone: (Variable 6 negfpone Local () () Default (Real 4 []) Source Public Required .false.)}) generic_name_01 [complex_module] [(= (Var 6 fpone) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 6 fptwo) (RealConstant 2.000000 (Real 4 [])) ()) (= (Var 6 fpzero) (RealConstant 0.000000 (Real 4 [])) ()) (= (Var 6 ione) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 6 izero) (IntegerConstant 0 (Integer 4 [])) ()) (= (Var 6 negfpone) (RealUnaryMinus (RealConstant 1.000000 (Real 4 [])) (Real 4 []) (RealConstant -1.000000 (Real 4 []))) ()) (= (Var 6 c) (DerivedTypeConstructor 6 complextype [(Var 6 fpone) (Var 6 fptwo)] (Derived 6 complextype []) ()) ()) (SubroutineCall 3 integer_add_subrout 3 add [((Var 6 ione)) ((Var 6 izero)) ((Var 6 a))] (Var 6 c)) (Print () [(DerivedRef (Var 6 a) 3 r (Real 4 []) ()) (DerivedRef (Var 6 a) 3 i (Real 4 []) ())] () ()) (SubroutineCall 3 real_add_subrout 3 add [((Var 6 fpzero)) ((Var 6 negfpone)) ((Var 6 a))] (Var 6 c)) (Print () [(DerivedRef (Var 6 a) 3 r (Real 4 []) ()) (DerivedRef (Var 6 a) 3 i (Real 4 []) ())] () ())])}) []) +(TranslationUnit (SymbolTable 1 {complex_module: (Module (SymbolTable 2 {complextype: (DerivedType (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.), integer_add_subrout: (ClassProcedure 3 integer_add_subrout integer_add_subrout 2 integer_add_subrout Source), r: (Variable 3 r Local () () Default (Real 4 []) Source Public Required .false.), real_add_subrout: (ClassProcedure 3 real_add_subrout real_add_subrout 2 real_add_subrout Source)}) complextype [r i] Source Public ()), integer_add_subrout: (Function (SymbolTable 4 {i: (Variable 4 i In () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 4 r In () () Default (Integer 4 []) Source Public Required .false.), sum: (Variable 4 sum Out () () Default (Derived 2 complextype []) Source Public Required .false.), this: (Variable 4 this In () () Default (Class 2 complextype []) Source Public Required .false.)}) integer_add_subrout [(Var 4 this) (Var 4 r) (Var 4 i) (Var 4 sum)] [] [(Print () [(StringConstant "Calling integer_add_subrout" (Character 1 27 () []))] () ()) (= (DerivedRef (Var 4 sum) 3 r (Real 4 []) ()) (RealBinOp (DerivedRef (Var 4 this) 3 r (Real 4 []) ()) Add (Cast (Var 4 r) IntegerToReal (Real 4 []) ()) (Real 4 []) ()) ()) (= (DerivedRef (Var 4 sum) 3 i (Real 4 []) ()) (RealBinOp (DerivedRef (Var 4 this) 3 i (Real 4 []) ()) Add (Cast (Var 4 i) IntegerToReal (Real 4 []) ()) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.), real_add_subrout: (Function (SymbolTable 5 {i: (Variable 5 i In () () Default (Real 4 []) Source Public Required .false.), r: (Variable 5 r In () () Default (Real 4 []) Source Public Required .false.), sum: (Variable 5 sum Out () () Default (Derived 2 complextype []) Source Public Required .false.), this: (Variable 5 this In () () Default (Class 2 complextype []) Source Public Required .false.)}) real_add_subrout [(Var 5 this) (Var 5 r) (Var 5 i) (Var 5 sum)] [] [(Print () [(StringConstant "Calling real_add_subrout" (Character 1 24 () []))] () ()) (= (DerivedRef (Var 5 sum) 3 r (Real 4 []) ()) (RealBinOp (DerivedRef (Var 5 this) 3 r (Real 4 []) ()) Add (Var 5 r) (Real 4 []) ()) ()) (= (DerivedRef (Var 5 sum) 3 i (Real 4 []) ()) (RealBinOp (DerivedRef (Var 5 this) 3 i (Real 4 []) ()) Add (Var 5 i) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.)}) complex_module [] .false. .false.), generic_name_01: (Program (SymbolTable 6 {a: (Variable 6 a Local () () Default (Derived 6 complextype []) Source Public Required .false.), c: (Variable 6 c Local () () Default (Derived 6 complextype []) Source Public Required .false.), complextype: (ExternalSymbol 6 complextype 2 complextype complex_module [] complextype Public), fpone: (Variable 6 fpone Local () () Default (Real 4 []) Source Public Required .false.), fptwo: (Variable 6 fptwo Local () () Default (Real 4 []) Source Public Required .false.), fpzero: (Variable 6 fpzero Local () () Default (Real 4 []) Source Public Required .false.), ione: (Variable 6 ione Local () () Default (Integer 4 []) Source Public Required .false.), izero: (Variable 6 izero Local () () Default (Integer 4 []) Source Public Required .false.), negfpone: (Variable 6 negfpone Local () () Default (Real 4 []) Source Public Required .false.)}) generic_name_01 [complex_module] [(= (Var 6 fpone) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 6 fptwo) (RealConstant 2.000000 (Real 4 [])) ()) (= (Var 6 fpzero) (RealConstant 0.000000 (Real 4 [])) ()) (= (Var 6 ione) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 6 izero) (IntegerConstant 0 (Integer 4 [])) ()) (= (Var 6 negfpone) (RealUnaryMinus (RealConstant 1.000000 (Real 4 [])) (Real 4 []) (RealConstant -1.000000 (Real 4 []))) ()) (= (Var 6 c) (DerivedTypeConstructor 6 complextype [(Var 6 fpone) (Var 6 fptwo)] (Derived 6 complextype []) ()) ()) (SubroutineCall 3 integer_add_subrout 3 add [((Var 6 ione)) ((Var 6 izero)) ((Var 6 a))] (Var 6 c)) (Print () [(DerivedRef (Var 6 a) 3 r (Real 4 []) ()) (DerivedRef (Var 6 a) 3 i (Real 4 []) ())] () ()) (SubroutineCall 3 real_add_subrout 3 add [((Var 6 fpzero)) ((Var 6 negfpone)) ((Var 6 a))] (Var 6 c)) (Print () [(DerivedRef (Var 6 a) 3 r (Real 4 []) ()) (DerivedRef (Var 6 a) 3 i (Real 4 []) ())] () ())])}) []) diff --git a/tests/reference/asr-implicit_typing2-d87e21a.json b/tests/reference/asr-implicit_typing2-d87e21a.json index 13f9de6b0a..8620fab1c7 100644 --- a/tests/reference/asr-implicit_typing2-d87e21a.json +++ b/tests/reference/asr-implicit_typing2-d87e21a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-implicit_typing2-d87e21a.stdout", - "stdout_hash": "63de72db75aa1d64d6c308a037142ada39423fd1f08ac2a17fdf5120", + "stdout_hash": "ef997564215a91543f43260d70ac539281538f9ec91f721a348ebaf9", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-implicit_typing2-d87e21a.stdout b/tests/reference/asr-implicit_typing2-d87e21a.stdout index 08dcfc311d..5e4910d836 100644 --- a/tests/reference/asr-implicit_typing2-d87e21a.stdout +++ b/tests/reference/asr-implicit_typing2-d87e21a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), b: (Variable 2 b Unspecified () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), ifault: (Variable 2 ifault Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Unspecified () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 2 ifault) (Var 2 r) (Var 2 n) (Var 2 b)] [] [(= (Var 2 ifault) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 2 r) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ())] () Source Public Implementation () .false. .false. .false.), g: (Function (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) Source Public Required .false.), g: (Variable 3 g ReturnVar () () Default (Integer 4 []) Source Public Required .false.), ifault: (Variable 3 ifault Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 3 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r Unspecified () () Default (Real 4 []) Source Public Required .false.)}) g [(Var 3 ifault) (Var 3 r) (Var 3 n) (Var 3 b)] [] [(= (Var 3 ifault) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 3 r) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ())] (Var 3 g) Source Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {a: (Variable 2 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), b: (Variable 2 b Unspecified () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 2 n))]) Source Public Required .false.), ifault: (Variable 2 ifault Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 2 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 2 r Unspecified () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 2 ifault) (Var 2 r) (Var 2 n) (Var 2 b)] [] [(= (Var 2 ifault) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 2 r) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ())] () Source Public Implementation () .false. .false. .false. .false.), g: (Function (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) Source Public Required .false.), b: (Variable 3 b Unspecified () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 3 n))]) Source Public Required .false.), g: (Variable 3 g ReturnVar () () Default (Integer 4 []) Source Public Required .false.), ifault: (Variable 3 ifault Unspecified () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 3 n Unspecified () () Default (Integer 4 []) Source Public Required .false.), r: (Variable 3 r Unspecified () () Default (Real 4 []) Source Public Required .false.)}) g [(Var 3 ifault) (Var 3 r) (Var 3 n) (Var 3 b)] [] [(= (Var 3 ifault) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 3 r) (Cast (IntegerConstant 3 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 3.000000 (Real 4 []))) ())] (Var 3 g) Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-intent_01-c1f267a.json b/tests/reference/asr-intent_01-c1f267a.json index b837d17656..7af10c19b1 100644 --- a/tests/reference/asr-intent_01-c1f267a.json +++ b/tests/reference/asr-intent_01-c1f267a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intent_01-c1f267a.stdout", - "stdout_hash": "5e2ab6b5bbad4d986518726933b02a4274def281bb6020a5741cc11a", + "stdout_hash": "92041bbe019d317634c17fb74288f6e183b74f6e86eaed0a4ad65f18", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intent_01-c1f267a.stdout b/tests/reference/asr-intent_01-c1f267a.stdout index 6553707a41..00c73f2bce 100644 --- a/tests/reference/asr-intent_01-c1f267a.stdout +++ b/tests/reference/asr-intent_01-c1f267a.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {dflt_intent: (Module (SymbolTable 2 {foo: (Function (SymbolTable 3 {c: (Variable 3 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 3 d Unspecified () () Default (Real 4 []) Source Public Required .false.), e: (Variable 3 e Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x)] [] [(= (Var 4 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 4 x) (Real 4 []) ()) ()) (Print () [(Var 4 f)] () ())] (Var 4 f) Source Public Implementation () .false. .false. .false.), g: (Variable 3 g Local () () Default (Real 4 []) Source Public Required .false.)}) foo [(Var 3 c) (Var 3 d)] [] [(= (Var 3 e) (FunctionCall 3 f () [((Var 3 c))] (Real 4 []) () ()) ()) (= (Var 3 g) (FunctionCall 3 f () [((Var 3 d))] (Real 4 []) () ()) ())] () Source Public Implementation () .false. .false. .false.)}) dflt_intent [] .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 [])))] ())])}) []) +(TranslationUnit (SymbolTable 1 {dflt_intent: (Module (SymbolTable 2 {foo: (Function (SymbolTable 3 {c: (Variable 3 c Unspecified () () Default (Real 4 []) Source Public Required .false.), d: (Variable 3 d Unspecified () () Default (Real 4 []) Source Public Required .false.), e: (Variable 3 e Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {f: (Variable 4 f ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x In () () Default (Real 4 []) Source Public Required .false.)}) f [(Var 4 x)] [] [(= (Var 4 f) (RealBinOp (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) Mul (Var 4 x) (Real 4 []) ()) ()) (Print () [(Var 4 f)] () ())] (Var 4 f) Source Public Implementation () .false. .false. .false. .false.), g: (Variable 3 g Local () () Default (Real 4 []) Source Public Required .false.)}) foo [(Var 3 c) (Var 3 d)] [] [(= (Var 3 e) (FunctionCall 3 f () [((Var 3 c))] (Real 4 []) () ()) ()) (= (Var 3 g) (FunctionCall 3 f () [((Var 3 d))] (Real 4 []) () ()) ())] () Source Public Implementation () .false. .false. .false. .false.)}) dflt_intent [] .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 [])))] ())])}) []) diff --git a/tests/reference/asr-interface_01-9dc98da.json b/tests/reference/asr-interface_01-9dc98da.json index a0c6df9b64..3db4e8fcf6 100644 --- a/tests/reference/asr-interface_01-9dc98da.json +++ b/tests/reference/asr-interface_01-9dc98da.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_01-9dc98da.stdout", - "stdout_hash": "72fd2c0a5ebf18ec2174706b9045f4927fcafc475ef1f2ce858cc8e3", + "stdout_hash": "619078441113540c8babb470045d2faac577a798a6887fdda226aeb5", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_01-9dc98da.stdout b/tests/reference/asr-interface_01-9dc98da.stdout index 6950862493..39ed51f886 100644 --- a/tests/reference/asr-interface_01-9dc98da.stdout +++ b/tests/reference/asr-interface_01-9dc98da.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {interface_01: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_01_mod [] a 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.), r: (Variable 5 r Local () () Default (Real 4 []) Source Public Required .false.)}) interface_01 [interface_01_mod] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 r) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) ()) (SubroutineCall 5 a@a2 5 a [((Var 5 r))] ()) (If (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 7.000000 (Real 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 i) (IntegerConstant 7 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4 [])) (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.)}) a1 [(Var 3 a)] [] [(= (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.), a2: (Function (SymbolTable 4 {a: (Variable 4 a InOut () () Default (Real 4 []) Source Public Required .false.)}) a2 [(Var 4 a)] [] [(= (Var 4 a) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.)}) interface_01_mod [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {interface_01: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_01_mod [] a 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.), r: (Variable 5 r Local () () Default (Real 4 []) Source Public Required .false.)}) interface_01 [interface_01_mod] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 r) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) ()) (SubroutineCall 5 a@a2 5 a [((Var 5 r))] ()) (If (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 7.000000 (Real 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 i) (IntegerConstant 7 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4 [])) (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.)}) a1 [(Var 3 a)] [] [(= (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.), a2: (Function (SymbolTable 4 {a: (Variable 4 a InOut () () Default (Real 4 []) Source Public Required .false.)}) a2 [(Var 4 a)] [] [(= (Var 4 a) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) (Real 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.)}) interface_01_mod [] .false. .false.)}) []) diff --git a/tests/reference/asr-interface_04-9570e2b.json b/tests/reference/asr-interface_04-9570e2b.json index 7f7d03343c..be75e4f7d1 100644 --- a/tests/reference/asr-interface_04-9570e2b.json +++ b/tests/reference/asr-interface_04-9570e2b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_04-9570e2b.stdout", - "stdout_hash": "446bf22af048ad81694ad8219d74f1217f71bba4307b3e0f6d87a73e", + "stdout_hash": "f57053e4e1868980ad6dc9065945616b962a4ca5068a7cebe6f5282c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_04-9570e2b.stdout b/tests/reference/asr-interface_04-9570e2b.stdout index 8fd3b53408..0690249ef9 100644 --- a/tests/reference/asr-interface_04-9570e2b.stdout +++ b/tests/reference/asr-interface_04-9570e2b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {interface_04: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_04_mod1 [] a Public), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_04_mod1 [] a1 Private), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.)}) interface_04 [interface_04_mod2] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (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.)}) a1 [(Var 3 a)] [] [(= (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.)}) interface_04_mod1 [] .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.)}) []) +(TranslationUnit (SymbolTable 1 {interface_04: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_04_mod1 [] a Public), a@a1: (ExternalSymbol 5 a@a1 2 a1 interface_04_mod1 [] a1 Private), i: (Variable 5 i Local () () Default (Integer 4 []) Source Public Required .false.)}) interface_04 [interface_04_mod2] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (SubroutineCall 5 a@a1 5 a [((Var 5 i))] ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (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.)}) a1 [(Var 3 a)] [] [(= (Var 3 a) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.)}) interface_04_mod1 [] .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.)}) []) diff --git a/tests/reference/asr-interface_05-5639d22.json b/tests/reference/asr-interface_05-5639d22.json index e6b34dd7ee..eb7d14e336 100644 --- a/tests/reference/asr-interface_05-5639d22.json +++ b/tests/reference/asr-interface_05-5639d22.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_05-5639d22.stdout", - "stdout_hash": "2d438ea507da62ef6ef7433bd7ee135b115fabb5de48302f2ad6ef8f", + "stdout_hash": "831dd9995d5336bf15a97d0ac628ab2b90265c75f95fb36b1441b088", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_05-5639d22.stdout b/tests/reference/asr-interface_05-5639d22.stdout index 5bb4e3cdb8..a4f0d14fef 100644 --- a/tests/reference/asr-interface_05-5639d22.stdout +++ b/tests/reference/asr-interface_05-5639d22.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {interface_05: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_05_mod [] a 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.), r: (Variable 5 r Local () () Default (Real 4 []) Source Public Required .false.)}) interface_05 [interface_05_mod] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (= (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4 []) () ()) ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 r) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) ()) (= (Var 5 r) (FunctionCall 5 a@a2 5 a [((Var 5 r))] (Real 4 []) () ()) ()) (If (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 7.000000 (Real 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 i) (IntegerConstant 7 (Integer 4 [])) ()) (= (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4 []) () ()) ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4 [])) (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.), a1: (Variable 3 a1 ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a1 [(Var 3 a)] [] [(= (Var 3 a1) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 3 a1) Source Public Implementation () .false. .false. .false.), a2: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), a2: (Variable 4 a2 ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) a2 [(Var 4 a)] [] [(= (Var 4 a2) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) (Real 4 []) ()) ())] (Var 4 a2) Source Public Implementation () .false. .false. .false.)}) interface_05_mod [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {interface_05: (Program (SymbolTable 5 {a: (ExternalSymbol 5 a 2 a interface_05_mod [] a 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.), r: (Variable 5 r Local () () Default (Real 4 []) Source Public Required .false.)}) interface_05 [interface_05_mod] [(= (Var 5 i) (IntegerConstant 5 (Integer 4 [])) ()) (= (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4 []) () ()) ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 6 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 r) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) ()) (= (Var 5 r) (FunctionCall 5 a@a2 5 a [((Var 5 r))] (Real 4 []) () ()) ()) (If (RealCompare (Var 5 r) NotEq (Cast (IntegerConstant 7 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 7.000000 (Real 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 5 i) (IntegerConstant 7 (Integer 4 [])) ()) (= (Var 5 i) (FunctionCall 5 a@a1 5 a [((Var 5 i))] (Integer 4 []) () ()) ()) (If (IntegerCompare (Var 5 i) NotEq (IntegerConstant 8 (Integer 4 [])) (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.), a1: (Variable 3 a1 ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) a1 [(Var 3 a)] [] [(= (Var 3 a1) (IntegerBinOp (Var 3 a) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 3 a1) Source Public Implementation () .false. .false. .false. .false.), a2: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), a2: (Variable 4 a2 ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) a2 [(Var 4 a)] [] [(= (Var 4 a2) (RealBinOp (Var 4 a) Add (Cast (IntegerConstant 1 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) (Real 4 []) ()) ())] (Var 4 a2) Source Public Implementation () .false. .false. .false. .false.)}) interface_05_mod [] .false. .false.)}) []) diff --git a/tests/reference/asr-interface_08-1848d3c.json b/tests/reference/asr-interface_08-1848d3c.json index 76cf213939..a4a253d816 100644 --- a/tests/reference/asr-interface_08-1848d3c.json +++ b/tests/reference/asr-interface_08-1848d3c.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_08-1848d3c.stdout", - "stdout_hash": "c849b40b33445f14229c09e8d7d0767748cfb7985af34ac3fe44b725", + "stdout_hash": "9ab2eb72764b583fbd6710a91effdeb88db57f4eefb9e6954dcbfb89", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_08-1848d3c.stdout b/tests/reference/asr-interface_08-1848d3c.stdout index 4ba7e15868..e723bc27b8 100644 --- a/tests/reference/asr-interface_08-1848d3c.stdout +++ b/tests/reference/asr-interface_08-1848d3c.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {interface_08: (Module (SymbolTable 2 {sub: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y In () () Default (Integer 4 []) Source Public Required .false.)}) sub [(Var 3 x) (Var 3 y)] [] [] () Source Public Interface () .false. .false. .false.)}) interface_08 [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {interface_08: (Module (SymbolTable 2 {sub: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y In () () Default (Integer 4 []) Source Public Required .false.)}) sub [(Var 3 x) (Var 3 y)] [] [] () Source Public Interface () .false. .false. .false. .false.)}) interface_08 [] .false. .false.)}) []) diff --git a/tests/reference/asr-interface_10-e9eb6ea.json b/tests/reference/asr-interface_10-e9eb6ea.json index f0807f38cf..6669328a7b 100644 --- a/tests/reference/asr-interface_10-e9eb6ea.json +++ b/tests/reference/asr-interface_10-e9eb6ea.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-interface_10-e9eb6ea.stdout", - "stdout_hash": "225678542d53830aa099cea44d843fdb4f02c6d3148eb22122c9a7eb", + "stdout_hash": "d0f6164c81578cfc0ec54f8bf173add9f5b1dbfb7bdb7527534a6040", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-interface_10-e9eb6ea.stdout b/tests/reference/asr-interface_10-e9eb6ea.stdout index d6901e19fa..809d24ef38 100644 --- a/tests/reference/asr-interface_10-e9eb6ea.stdout +++ b/tests/reference/asr-interface_10-e9eb6ea.stdout @@ -1 +1 @@ -(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 (Character 1 1 () []) Source Public Required .false.), y: (Variable 4 y Local () () Default (Character 1 1 () []) Source Public Required .false.)}) interface_10 [interface_10_m] [(= (Var 4 x) (StringConstant "A" (Character 1 1 () [])) ()) (SubroutineCall 4 chars@identity 4 chars [((Var 4 x)) ((Var 4 y))] ()) (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 (Character 1 1 () []) Source Public Required .false.), y: (Variable 3 y Out () () Default (Character 1 1 () []) Source Public Required .false.)}) identity [(Var 3 x) (Var 3 y)] [] [(= (Var 3 y) (Var 3 x) ())] () Source Public Implementation () .false. .false. .false.)}) interface_10_m [] .false. .false.)}) []) +(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 (Character 1 1 () []) Source Public Required .false.), y: (Variable 4 y Local () () Default (Character 1 1 () []) Source Public Required .false.)}) interface_10 [interface_10_m] [(= (Var 4 x) (StringConstant "A" (Character 1 1 () [])) ()) (SubroutineCall 4 chars@identity 4 chars [((Var 4 x)) ((Var 4 y))] ()) (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 (Character 1 1 () []) Source Public Required .false.), y: (Variable 3 y Out () () Default (Character 1 1 () []) Source Public Required .false.)}) identity [(Var 3 x) (Var 3 y)] [] [(= (Var 3 y) (Var 3 x) ())] () Source Public Implementation () .false. .false. .false. .false.)}) interface_10_m [] .false. .false.)}) []) diff --git a/tests/reference/asr-intrinsics_03-ef06d46.json b/tests/reference/asr-intrinsics_03-ef06d46.json index fbe4d3b6af..5c9de00752 100644 --- a/tests/reference/asr-intrinsics_03-ef06d46.json +++ b/tests/reference/asr-intrinsics_03-ef06d46.json @@ -2,11 +2,11 @@ "basename": "asr-intrinsics_03-ef06d46", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_03.f90", - "infile_hash": "eda277452cad2d7bc3ef98963677fc276c09ce4d517756982a0d921d", + "infile_hash": "8e3eaf17fa2610e5ebdf1fd94dbf2be8ff26f85160239bcec926e16f", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_03-ef06d46.stdout", - "stdout_hash": "738b7ae4d5cbd362628220adcf323642ec4d646d2e15ccfaea8d0cbf", + "stdout_hash": "71ab6b62dda9b0058790e4ad6536fb189f11469b745dd9139df19a35", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_03-ef06d46.stdout b/tests/reference/asr-intrinsics_03-ef06d46.stdout index 8b3f74f2f7..48265f578f 100644 --- a/tests/reference/asr-intrinsics_03-ef06d46.stdout +++ b/tests/reference/asr-intrinsics_03-ef06d46.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {intrinsics_03: (Program (SymbolTable 2 {cos: (ExternalSymbol 2 cos 4 cos lfortran_intrinsic_math [] cos Private), cos@scos: (ExternalSymbol 2 cos@scos 4 scos lfortran_intrinsic_math [] scos Private), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) intrinsics_03 [] [(= (Var 2 x) (FunctionCall 2 cos@scos 2 cos [((RealConstant 9.500000 (Real 4 [])))] (Real 4 []) (RealConstant -0.997172 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) +(TranslationUnit (SymbolTable 1 {intrinsics_03: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 8 []) Source Public Required .false.), cos: (ExternalSymbol 2 cos 6 cos lfortran_intrinsic_math [] cos Private), cos@scos: (ExternalSymbol 2 cos@scos 6 scos lfortran_intrinsic_math [] scos Private), dabs: (ExternalSymbol 2 dabs 226 dabs lfortran_intrinsic_math2 [] dabs Private), dcos: (ExternalSymbol 2 dcos 6 dcos lfortran_intrinsic_math [] dcos Private), dp: (ExternalSymbol 2 dp 4 real64 lfortran_intrinsic_iso_fortran_env [] real64 Public), r1: (Variable 2 r1 Local () () Default (Real 8 []) Source Public Required .false.), r2: (Variable 2 r2 Local () () Default (Real 8 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) intrinsics_03 [iso_fortran_env] [(= (Var 2 x) (FunctionCall 2 cos@scos 2 cos [((RealConstant 9.500000 (Real 4 [])))] (Real 4 []) (RealConstant -0.997172 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 a) (RealConstant 4.200000 (Real 8 [])) ()) (= (Var 2 r1) (FunctionCall 2 dcos () [((Var 2 a))] (Real 8 []) () ()) ()) (= (Var 2 r2) (RealUnaryMinus (RealConstant 0.490261 (Real 8 [])) (Real 8 []) (RealConstant -0.490261 (Real 8 []))) ()) (If (RealCompare (FunctionCall 2 dabs () [((RealBinOp (Var 2 r1) Sub (Var 2 r2) (Real 8 []) ()))] (Real 8 []) () ()) Gt (RealConstant 0.000000 (Real 8 [])) (Logical 4 []) ()) [(ErrorStop ())] [])]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-intrinsics_06-8523892.json b/tests/reference/asr-intrinsics_06-8523892.json index eb8644b476..8e31e93254 100644 --- a/tests/reference/asr-intrinsics_06-8523892.json +++ b/tests/reference/asr-intrinsics_06-8523892.json @@ -2,11 +2,11 @@ "basename": "asr-intrinsics_06-8523892", "cmd": "lfortran --show-asr --no-color {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_06.f90", - "infile_hash": "159c10373053040b4614f7468175543b4735da80807fbb7ef9bad071", + "infile_hash": "45568686a8770f0612e168afdd5bfba81ef25b7ad61daf3ef5960d15", "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_06-8523892.stdout", - "stdout_hash": "32d977c48ba6e90e2526e80fd31b8b074dfa761bc919156b5d794df2", + "stdout_hash": "31dd3369dc7452212151bf8e1c539b8e2ae92eb006aded9a1abf6343", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_06-8523892.stdout b/tests/reference/asr-intrinsics_06-8523892.stdout index b359808fff..5922276b98 100644 --- a/tests/reference/asr-intrinsics_06-8523892.stdout +++ b/tests/reference/asr-intrinsics_06-8523892.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {intrinsics_06: (Program (SymbolTable 2 {acos: (ExternalSymbol 2 acos 4 acos lfortran_intrinsic_math [] acos Private), acos@sacos: (ExternalSymbol 2 acos@sacos 4 sacos lfortran_intrinsic_math [] sacos Private), acosh: (ExternalSymbol 2 acosh 4 acosh lfortran_intrinsic_math [] acosh Private), acosh@sacosh: (ExternalSymbol 2 acosh@sacosh 4 sacosh lfortran_intrinsic_math [] sacosh Private), asin: (ExternalSymbol 2 asin 4 asin lfortran_intrinsic_math [] asin Private), asin@sasin: (ExternalSymbol 2 asin@sasin 4 sasin lfortran_intrinsic_math [] sasin Private), asinh: (ExternalSymbol 2 asinh 4 asinh lfortran_intrinsic_math [] asinh Private), asinh@sasinh: (ExternalSymbol 2 asinh@sasinh 4 sasinh lfortran_intrinsic_math [] sasinh Private), atan: (ExternalSymbol 2 atan 4 atan lfortran_intrinsic_math [] atan Private), atan@satan: (ExternalSymbol 2 atan@satan 4 satan lfortran_intrinsic_math [] satan Private), atanh: (ExternalSymbol 2 atanh 4 atanh lfortran_intrinsic_math [] atanh Private), atanh@satanh: (ExternalSymbol 2 atanh@satanh 4 satanh lfortran_intrinsic_math [] satanh Private), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) intrinsics_06 [] [(= (Var 2 x) (FunctionCall 2 asin@sasin 2 asin [((RealConstant 0.841471 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 acos@sacos 2 acos [((RealConstant 0.540302 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 atan@satan 2 atan [((RealConstant 1.557408 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 asinh@sasinh 2 asinh [((RealConstant 1.175201 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 acosh@sacosh 2 acosh [((RealConstant 1.543081 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 atanh@satanh 2 atanh [((RealConstant 0.761594 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) +(TranslationUnit (SymbolTable 1 {intrinsics_06: (Program (SymbolTable 2 {acos: (ExternalSymbol 2 acos 4 acos lfortran_intrinsic_math [] acos Private), acos@sacos: (ExternalSymbol 2 acos@sacos 4 sacos lfortran_intrinsic_math [] sacos Private), acosh: (ExternalSymbol 2 acosh 4 acosh lfortran_intrinsic_math [] acosh Private), acosh@sacosh: (ExternalSymbol 2 acosh@sacosh 4 sacosh lfortran_intrinsic_math [] sacosh Private), asin: (ExternalSymbol 2 asin 4 asin lfortran_intrinsic_math [] asin Private), asin@sasin: (ExternalSymbol 2 asin@sasin 4 sasin lfortran_intrinsic_math [] sasin Private), asinh: (ExternalSymbol 2 asinh 4 asinh lfortran_intrinsic_math [] asinh Private), asinh@sasinh: (ExternalSymbol 2 asinh@sasinh 4 sasinh lfortran_intrinsic_math [] sasinh Private), atan: (ExternalSymbol 2 atan 4 atan lfortran_intrinsic_math [] atan Private), atan@satan: (ExternalSymbol 2 atan@satan 4 satan lfortran_intrinsic_math [] satan Private), atanh: (ExternalSymbol 2 atanh 4 atanh lfortran_intrinsic_math [] atanh Private), atanh@satanh: (ExternalSymbol 2 atanh@satanh 4 satanh lfortran_intrinsic_math [] satanh Private), datan: (ExternalSymbol 2 datan 4 datan lfortran_intrinsic_math [] datan Private), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) intrinsics_06 [] [(= (Var 2 x) (FunctionCall 2 asin@sasin 2 asin [((RealConstant 0.841471 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 acos@sacos 2 acos [((RealConstant 0.540302 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 atan@satan 2 atan [((RealConstant 1.557408 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (Cast (FunctionCall 2 datan () [((RealConstant 1.557408 (Real 4 [])))] (Real 8 []) (RealConstant 1.000000 (Real 4 [])) ()) RealToReal (Real 4 []) (RealConstant 1.000000 (Real 4 []))) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 asinh@sasinh 2 asinh [((RealConstant 1.175201 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 acosh@sacosh 2 acosh [((RealConstant 1.543081 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ()) (= (Var 2 x) (FunctionCall 2 atanh@satanh 2 atanh [((RealConstant 0.761594 (Real 4 [])))] (Real 4 []) (RealConstant 1.000000 (Real 4 [])) ()) ()) (Print () [(Var 2 x)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math)}) []) diff --git a/tests/reference/asr-intrinsics_26-f10d0e6.json b/tests/reference/asr-intrinsics_26-f10d0e6.json index 991dbc0231..6b15f1bb97 100644 --- a/tests/reference/asr-intrinsics_26-f10d0e6.json +++ b/tests/reference/asr-intrinsics_26-f10d0e6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_26-f10d0e6.stdout", - "stdout_hash": "c2a21033a22e37877043ea9f509553066021a6ed1aeb3033beca0c3e", + "stdout_hash": "ef1728df2b0b3abe7858b3871cfe4fc80350926d731dee3c774dd56c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_26-f10d0e6.stdout b/tests/reference/asr-intrinsics_26-f10d0e6.stdout index ee0c9b9860..3d3595463b 100644 --- a/tests/reference/asr-intrinsics_26-f10d0e6.stdout +++ b/tests/reference/asr-intrinsics_26-f10d0e6.stdout @@ -1 +1 @@ -(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 [])) () Save (Integer 4 []) Source Public Required .false.)}) intrinsics_26 [stdlib_bitsets_64] [(Print () [(FunctionCall 4 all_set () [((Var 4 i)) ((IntegerConstant 5 (Integer 4 [])))] (Logical 4 []) () ())] () ())]), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit), stdlib_bitsets_64: (Module (SymbolTable 2 {all_set: (Function (SymbolTable 3 {btest: (ExternalSymbol 3 btest 6 btest lfortran_intrinsic_bit [] btest Private), btest@btest32: (ExternalSymbol 3 btest@btest32 6 btest32 lfortran_intrinsic_bit [] btest32 Private), num_bits: (Variable 3 num_bits In () () Default (Integer 4 []) Source Public Required .false.), pos: (Variable 3 pos Local () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 3 res ReturnVar () () Default (Logical 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) all_set [(Var 3 x) (Var 3 num_bits)] [] [(= (Var 3 res) (LogicalConstant .true. (Logical 4 [])) ()) (DoLoop ((Var 3 pos) (IntegerConstant 0 (Integer 4 [])) (IntegerBinOp (Var 3 num_bits) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) [(If (LogicalNot (FunctionCall 3 btest@btest32 3 btest [((Var 3 x)) ((Var 3 pos))] (Logical 4 []) () ()) (Logical 4 []) ()) [(= (Var 3 res) (LogicalConstant .false. (Logical 4 [])) ())] [])])] (Var 3 res) Source Public Implementation () .false. .false. .false.)}) stdlib_bitsets_64 [lfortran_intrinsic_bit] .false. .false.)}) []) +(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 [])) () Save (Integer 4 []) Source Public Required .false.)}) intrinsics_26 [stdlib_bitsets_64] [(Print () [(FunctionCall 4 all_set () [((Var 4 i)) ((IntegerConstant 5 (Integer 4 [])))] (Logical 4 []) () ())] () ())]), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_bit: (IntrinsicModule lfortran_intrinsic_bit), stdlib_bitsets_64: (Module (SymbolTable 2 {all_set: (Function (SymbolTable 3 {btest: (ExternalSymbol 3 btest 6 btest lfortran_intrinsic_bit [] btest Private), btest@btest32: (ExternalSymbol 3 btest@btest32 6 btest32 lfortran_intrinsic_bit [] btest32 Private), num_bits: (Variable 3 num_bits In () () Default (Integer 4 []) Source Public Required .false.), pos: (Variable 3 pos Local () () Default (Integer 4 []) Source Public Required .false.), res: (Variable 3 res ReturnVar () () Default (Logical 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) all_set [(Var 3 x) (Var 3 num_bits)] [] [(= (Var 3 res) (LogicalConstant .true. (Logical 4 [])) ()) (DoLoop ((Var 3 pos) (IntegerConstant 0 (Integer 4 [])) (IntegerBinOp (Var 3 num_bits) Sub (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) [(If (LogicalNot (FunctionCall 3 btest@btest32 3 btest [((Var 3 x)) ((Var 3 pos))] (Logical 4 []) () ()) (Logical 4 []) ()) [(= (Var 3 res) (LogicalConstant .false. (Logical 4 [])) ())] [])])] (Var 3 res) Source Public Implementation () .false. .false. .false. .false.)}) stdlib_bitsets_64 [lfortran_intrinsic_bit] .false. .false.)}) []) diff --git a/tests/reference/asr-intrinsics_31-9b91cfb.json b/tests/reference/asr-intrinsics_31-9b91cfb.json index 2db269b1f2..22bc79dde4 100644 --- a/tests/reference/asr-intrinsics_31-9b91cfb.json +++ b/tests/reference/asr-intrinsics_31-9b91cfb.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_31-9b91cfb.stdout", - "stdout_hash": "20a21c3f7a8c26825076125708516dc19dd5fd4659622228fab8956c", + "stdout_hash": "b6065d364bc2d09c44b8b793f6613c27a9274018a014204b09df007d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_31-9b91cfb.stdout b/tests/reference/asr-intrinsics_31-9b91cfb.stdout index 9ccd02ab8a..9d96fb1ad6 100644 --- a/tests/reference/asr-intrinsics_31-9b91cfb.stdout +++ b/tests/reference/asr-intrinsics_31-9b91cfb.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {intrinsics_31: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 101 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 101 sabs lfortran_intrinsic_math [] sabs Private), ceiling: (ExternalSymbol 2 ceiling 13 ceiling lfortran_intrinsic_math2 [] ceiling Private), ceiling@dceiling: (ExternalSymbol 2 ceiling@dceiling 13 dceiling lfortran_intrinsic_math2 [] dceiling Private), ceiling@sceiling: (ExternalSymbol 2 ceiling@sceiling 13 sceiling lfortran_intrinsic_math2 [] sceiling Private), dp: (Variable 2 dp Local (FunctionCall 2 kind () [((RealConstant 0.000000 (Real 8 [])))] (Integer 4 []) (IntegerConstant 8 (Integer 4 [])) ()) (IntegerConstant 8 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false.), kind: (ExternalSymbol 2 kind 4 kind lfortran_intrinsic_kind [] kind Private), w: (Variable 2 w Local (RealUnaryMinus (RealConstant 1.000001 (Real 8 [])) (Real 8 []) (RealConstant -1.000001 (Real 8 []))) () Save (Real 8 []) Source Public Required .false.), w_ceil: (Variable 2 w_ceil Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local (RealConstant 63.290000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), x_ceil: (Variable 2 x_ceil Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local (RealUnaryMinus (RealConstant 63.590000 (Real 4 [])) (Real 4 []) (RealConstant -63.590000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y_ceil: (Variable 2 y_ceil Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 2 z Local (RealConstant 0.000001 (Real 8 [])) () Save (Real 8 []) Source Public Required .false.), z_ceil: (Variable 2 z_ceil Local () () Default (Integer 4 []) Source Public Required .false.)}) intrinsics_31 [lfortran_intrinsic_kind] [(= (Var 2 x_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 y_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 z_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 z))] (Integer 4 []) () ()) ()) (= (Var 2 w_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 w))] (Integer 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x_ceil) Sub (Cast (IntegerConstant 64 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 64.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 y_ceil) Sub (Cast (IntegerUnaryMinus (IntegerConstant 63 (Integer 4 [])) (Integer 4 []) (IntegerConstant -63 (Integer 4 []))) IntegerToReal (Real 4 []) (RealConstant -63.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 z_ceil) NotEq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 w_ceil) NotEq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (Print () [(Var 2 x_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 y_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 z_ceil)] () ()) (Print () [(Var 2 w_ceil)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_kind: (IntrinsicModule lfortran_intrinsic_kind), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) +(TranslationUnit (SymbolTable 1 {intrinsics_31: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 104 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 104 sabs lfortran_intrinsic_math [] sabs Private), ceiling: (ExternalSymbol 2 ceiling 13 ceiling lfortran_intrinsic_math2 [] ceiling Private), ceiling@dceiling: (ExternalSymbol 2 ceiling@dceiling 13 dceiling lfortran_intrinsic_math2 [] dceiling Private), ceiling@sceiling: (ExternalSymbol 2 ceiling@sceiling 13 sceiling lfortran_intrinsic_math2 [] sceiling Private), dp: (Variable 2 dp Local (FunctionCall 2 kind () [((RealConstant 0.000000 (Real 8 [])))] (Integer 4 []) (IntegerConstant 8 (Integer 4 [])) ()) (IntegerConstant 8 (Integer 4 [])) Parameter (Integer 4 []) Source Public Required .false.), kind: (ExternalSymbol 2 kind 4 kind lfortran_intrinsic_kind [] kind Private), w: (Variable 2 w Local (RealUnaryMinus (RealConstant 1.000001 (Real 8 [])) (Real 8 []) (RealConstant -1.000001 (Real 8 []))) () Save (Real 8 []) Source Public Required .false.), w_ceil: (Variable 2 w_ceil Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local (RealConstant 63.290000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), x_ceil: (Variable 2 x_ceil Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local (RealUnaryMinus (RealConstant 63.590000 (Real 4 [])) (Real 4 []) (RealConstant -63.590000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), y_ceil: (Variable 2 y_ceil Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 2 z Local (RealConstant 0.000001 (Real 8 [])) () Save (Real 8 []) Source Public Required .false.), z_ceil: (Variable 2 z_ceil Local () () Default (Integer 4 []) Source Public Required .false.)}) intrinsics_31 [lfortran_intrinsic_kind] [(= (Var 2 x_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 y_ceil) (Cast (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y))] (Integer 4 []) () ()) IntegerToReal (Real 4 []) ()) ()) (= (Var 2 z_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 z))] (Integer 4 []) () ()) ()) (= (Var 2 w_ceil) (FunctionCall 2 ceiling@dceiling 2 ceiling [((Var 2 w))] (Integer 4 []) () ()) ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x_ceil) Sub (Cast (IntegerConstant 64 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 64.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 y_ceil) Sub (Cast (IntegerUnaryMinus (IntegerConstant 63 (Integer 4 [])) (Integer 4 []) (IntegerConstant -63 (Integer 4 []))) IntegerToReal (Real 4 []) (RealConstant -63.000000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (RealConstant 0.000010 (Real 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 z_ceil) NotEq (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) ()) [(ErrorStop ())] []) (If (IntegerCompare (Var 2 w_ceil) NotEq (IntegerUnaryMinus (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) (IntegerConstant -1 (Integer 4 []))) (Logical 4 []) ()) [(ErrorStop ())] []) (Print () [(Var 2 x_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 x_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 y_ceil) (FunctionCall 2 ceiling@sceiling 2 ceiling [((Var 2 y_ceil))] (Integer 4 []) () ())] () ()) (Print () [(Var 2 z_ceil)] () ()) (Print () [(Var 2 w_ceil)] () ())]), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_kind: (IntrinsicModule lfortran_intrinsic_kind), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3)}) []) diff --git a/tests/reference/asr-intrinsics_35-10733ec.json b/tests/reference/asr-intrinsics_35-10733ec.json index 0f0b0fa07e..6bdeffbaff 100644 --- a/tests/reference/asr-intrinsics_35-10733ec.json +++ b/tests/reference/asr-intrinsics_35-10733ec.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-intrinsics_35-10733ec.stdout", - "stdout_hash": "7bfdf700aa9474cfadf1093f5eb2f1234c3a917f207e655792f2a429", + "stdout_hash": "ea746792094ba71c3c5147aea5f7bcb33a57a4a86d8d91aa77566ffb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-intrinsics_35-10733ec.stdout b/tests/reference/asr-intrinsics_35-10733ec.stdout index 96409f2a7b..b949d28f1b 100644 --- a/tests/reference/asr-intrinsics_35-10733ec.stdout +++ b/tests/reference/asr-intrinsics_35-10733ec.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), test_any: (Program (SymbolTable 2 {any: (ExternalSymbol 2 any 5 any lfortran_intrinsic_builtin [] any Private), l: (Variable 2 l Local () () Default (Logical 4 []) Source Public Required .false.), section: (Function (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) section [] [] [(= (Var 3 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 3 b) (IntegerConstant 1 (Integer 4 [])) ()) (= (ArrayItem (Var 3 b) [(() (IntegerConstant 2 (Integer 4 [])) ()) (() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ()) (Print () [(FunctionCall 2 any () [((IntegerCompare (Var 3 a) Eq (Var 3 b) (Logical 4 []) ())) ((IntegerConstant 1 (Integer 4 [])))] (Logical 4 []) () ())] () ()) (Print () [(FunctionCall 2 any () [((IntegerCompare (Var 3 a) Eq (Var 3 b) (Logical 4 []) ())) ((IntegerConstant 2 (Integer 4 [])))] (Logical 4 []) () ())] () ())] () Source Public Implementation () .false. .false. .false.)}) test_any [] [(= (Var 2 l) (FunctionCall 2 any () [((ArrayConstant [(LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 []))] (Logical 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])))] (Logical 4 []) () ()) ()) (Print () [(Var 2 l)] () ()) (SubroutineCall 2 section () [] ())])}) []) +(TranslationUnit (SymbolTable 1 {lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), test_any: (Program (SymbolTable 2 {any: (ExternalSymbol 2 any 5 any lfortran_intrinsic_builtin [] any Private), l: (Variable 2 l Local () () Default (Logical 4 []) Source Public Required .false.), section: (Function (SymbolTable 3 {a: (Variable 3 a Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 3 b Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 2 (Integer 4 []))) ((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))]) Source Public Required .false.)}) section [] [] [(= (Var 3 a) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 3 b) (IntegerConstant 1 (Integer 4 [])) ()) (= (ArrayItem (Var 3 b) [(() (IntegerConstant 2 (Integer 4 [])) ()) (() (IntegerConstant 2 (Integer 4 [])) ())] (Integer 4 []) ()) (IntegerConstant 2 (Integer 4 [])) ()) (Print () [(FunctionCall 2 any () [((IntegerCompare (Var 3 a) Eq (Var 3 b) (Logical 4 []) ())) ((IntegerConstant 1 (Integer 4 [])))] (Logical 4 []) () ())] () ()) (Print () [(FunctionCall 2 any () [((IntegerCompare (Var 3 a) Eq (Var 3 b) (Logical 4 []) ())) ((IntegerConstant 2 (Integer 4 [])))] (Logical 4 []) () ())] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) test_any [] [(= (Var 2 l) (FunctionCall 2 any () [((ArrayConstant [(LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 [])) (LogicalConstant .true. (Logical 4 []))] (Logical 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 3 (Integer 4 [])))])))] (Logical 4 []) () ()) ()) (Print () [(Var 2 l)] () ()) (SubroutineCall 2 section () [] ())])}) []) diff --git a/tests/reference/asr-issue532-4bdd3b3.json b/tests/reference/asr-issue532-4bdd3b3.json index 924b508aec..e478ef77c1 100644 --- a/tests/reference/asr-issue532-4bdd3b3.json +++ b/tests/reference/asr-issue532-4bdd3b3.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-issue532-4bdd3b3.stdout", - "stdout_hash": "b08631b7bbf6ae74f52cb7ffc5669878deda272d0fc4bd7a8533c905", + "stdout_hash": "28fec8bd37b6762b67a72812fba0f123c332a8ad035d434dec517955", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-issue532-4bdd3b3.stdout b/tests/reference/asr-issue532-4bdd3b3.stdout index cd48f2085f..8fece80e6f 100644 --- a/tests/reference/asr-issue532-4bdd3b3.stdout +++ b/tests/reference/asr-issue532-4bdd3b3.stdout @@ -1 +1 @@ -(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.), real: (ExternalSymbol 4 real 7 real lfortran_intrinsic_builtin [] real Private), x: (Variable 4 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 4 y In () () Default (Integer 4 []) Source Public Required .false.)}) imodulo [(Var 4 x) (Var 4 y)] [] [(= (Var 4 r) (IntegerBinOp (FunctionCall 2 sfloor () [((Cast (Var 4 x) IntegerToReal (Real 4 []) ()))] (Integer 4 []) () ()) Mul (Var 4 y) (Integer 4 []) ()) ())] (Var 4 r) Source Public Implementation () .false. .false. .false.), sfloor: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Real 4 []) Source Public Required .false.)}) sfloor [(Var 3 x)] [] [(= (Var 3 r) (Cast (Var 3 x) RealToInteger (Integer 4 []) ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) issue532_mod [lfortran_intrinsic_builtin] .false. .false.), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin)}) []) +(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.), real: (ExternalSymbol 4 real 7 real lfortran_intrinsic_builtin [] real Private), x: (Variable 4 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 4 y In () () Default (Integer 4 []) Source Public Required .false.)}) imodulo [(Var 4 x) (Var 4 y)] [] [(= (Var 4 r) (IntegerBinOp (FunctionCall 2 sfloor () [((Cast (Var 4 x) IntegerToReal (Real 4 []) ()))] (Integer 4 []) () ()) Mul (Var 4 y) (Integer 4 []) ()) ())] (Var 4 r) Source Public Implementation () .false. .false. .false. .false.), sfloor: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x In () () Default (Real 4 []) Source Public Required .false.)}) sfloor [(Var 3 x)] [] [(= (Var 3 r) (Cast (Var 3 x) RealToInteger (Integer 4 []) ()) ())] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.)}) issue532_mod [lfortran_intrinsic_builtin] .false. .false.), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin)}) []) diff --git a/tests/reference/asr-kokkos_program2-8391215.json b/tests/reference/asr-kokkos_program2-8391215.json index 32321b8ce1..bd332946f4 100644 --- a/tests/reference/asr-kokkos_program2-8391215.json +++ b/tests/reference/asr-kokkos_program2-8391215.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-kokkos_program2-8391215.stdout", - "stdout_hash": "f88f3d33d8403570dfabaa50ad44badea5f692b929c8375acdbf8ebe", + "stdout_hash": "f2d7170aba22df0abd737d54b3244c3c5f309e5c45d0fad2c4f27f11", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-kokkos_program2-8391215.stdout b/tests/reference/asr-kokkos_program2-8391215.stdout index 16e3ee6c9a..f3a699bd60 100644 --- a/tests/reference/asr-kokkos_program2-8391215.stdout +++ b/tests/reference/asr-kokkos_program2-8391215.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {kokkos_program2: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), nsize: (Variable 2 nsize Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 2 scalar Local () () Default (Real 4 []) Source Public Required .false.), triad: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 [(() ())]) Source Public Required .false.), c: (Variable 3 c Out () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 3 n Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 3 scalar In () () Default (Real 4 []) Source Public Required .false.)}) triad [(Var 3 a) (Var 3 b) (Var 3 scalar) (Var 3 c)] [] [(= (Var 3 n) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) (DoConcurrentLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (Var 3 n) ()) [(= (ArrayItem (Var 3 c) [(() (Var 3 i) ())] (Real 4 []) ()) (RealBinOp (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4 []) ()) Add (RealBinOp (Var 3 scalar) Mul (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Real 4 []) ()) (Real 4 []) ()) (Real 4 []) ()) ())])] () Source Public Implementation () .false. .false. .false.)}) kokkos_program2 [] [(= (Var 2 scalar) (Cast (IntegerConstant 10 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 10.000000 (Real 4 []))) ()) (= (Var 2 nsize) (ArraySize (Var 2 a) () (Integer 4 []) (IntegerConstant 10000 (Integer 4 []))) ()) (DoConcurrentLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 nsize) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4 []) ()) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 4 []) ()) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) ())]) (SubroutineCall 2 triad () [((Var 2 a)) ((Var 2 b)) ((Var 2 scalar)) ((Var 2 c))] ()) (Print () [(StringConstant "End Stream Triad" (Character 1 16 () []))] () ())])}) []) +(TranslationUnit (SymbolTable 1 {kokkos_program2: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 10000 (Integer 4 [])))]) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), nsize: (Variable 2 nsize Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 2 scalar Local () () Default (Real 4 []) Source Public Required .false.), triad: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Real 4 [(() ())]) Source Public Required .false.), b: (Variable 3 b In () () Default (Real 4 [(() ())]) Source Public Required .false.), c: (Variable 3 c Out () () Default (Real 4 [(() ())]) Source Public Required .false.), i: (Variable 3 i Local () () Default (Integer 4 []) Source Public Required .false.), n: (Variable 3 n Local () () Default (Integer 4 []) Source Public Required .false.), scalar: (Variable 3 scalar In () () Default (Real 4 []) Source Public Required .false.)}) triad [(Var 3 a) (Var 3 b) (Var 3 scalar) (Var 3 c)] [] [(= (Var 3 n) (ArraySize (Var 3 a) () (Integer 4 []) ()) ()) (DoConcurrentLoop ((Var 3 i) (IntegerConstant 1 (Integer 4 [])) (Var 3 n) ()) [(= (ArrayItem (Var 3 c) [(() (Var 3 i) ())] (Real 4 []) ()) (RealBinOp (ArrayItem (Var 3 a) [(() (Var 3 i) ())] (Real 4 []) ()) Add (RealBinOp (Var 3 scalar) Mul (ArrayItem (Var 3 b) [(() (Var 3 i) ())] (Real 4 []) ()) (Real 4 []) ()) (Real 4 []) ()) ())])] () Source Public Implementation () .false. .false. .false. .false.)}) kokkos_program2 [] [(= (Var 2 scalar) (Cast (IntegerConstant 10 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 10.000000 (Real 4 []))) ()) (= (Var 2 nsize) (ArraySize (Var 2 a) () (Integer 4 []) (IntegerConstant 10000 (Integer 4 []))) ()) (DoConcurrentLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 nsize) ()) [(= (ArrayItem (Var 2 a) [(() (Var 2 i) ())] (Real 4 []) ()) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) ()) (= (ArrayItem (Var 2 b) [(() (Var 2 i) ())] (Real 4 []) ()) (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) ())]) (SubroutineCall 2 triad () [((Var 2 a)) ((Var 2 b)) ((Var 2 scalar)) ((Var 2 c))] ()) (Print () [(StringConstant "End Stream Triad" (Character 1 16 () []))] () ())])}) []) diff --git a/tests/reference/asr-kwargs_02-1588831.json b/tests/reference/asr-kwargs_02-1588831.json index 8725c775b6..3baa2a0c85 100644 --- a/tests/reference/asr-kwargs_02-1588831.json +++ b/tests/reference/asr-kwargs_02-1588831.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-kwargs_02-1588831.stdout", - "stdout_hash": "b6438486b94c0e4928b009c002f4f5a61d18f3aca1c9e6e0cbac6639", + "stdout_hash": "229a05fe78f59d35029cf4289f0e0a7dc5b76627d01df40f8a01eb7f", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-kwargs_02-1588831.stdout b/tests/reference/asr-kwargs_02-1588831.stdout index 38583c5c76..8a5422b044 100644 --- a/tests/reference/asr-kwargs_02-1588831.stdout +++ b/tests/reference/asr-kwargs_02-1588831.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {kwargs_02: (Program (SymbolTable 6 {}) kwargs_02 [] []), stdlib_logger: (Module (SymbolTable 2 {add_log_file: (Function (SymbolTable 4 {filename: (Variable 4 filename In () () Default (Character 1 -1 () []) Source Public Required .false.), self: (Variable 4 self InOut () () Default (Class 2 logger_type []) Source Public Required .false.), unit: (Variable 4 unit Out () () Default (Integer 4 []) Source Public Optional .false.)}) add_log_file [(Var 4 self) (Var 4 filename) (Var 4 unit)] [] [(SubroutineCall 3 log_io_error () [((IntegerConstant 1 (Integer 4 []))) ((Var 4 filename)) ((Var 4 unit))] (Var 4 self))] () Source Public Implementation () .false. .false. .false.), log_io_error: (Function (SymbolTable 5 {code: (Variable 5 code In () () Default (Integer 4 []) Source Public Required .false.), filename: (Variable 5 filename In () () Default (Character 1 -1 () []) Source Public Optional .false.), self: (Variable 5 self InOut () () Default (Class 2 logger_type []) Source Public Required .false.), unit: (Variable 5 unit Out () () Default (Integer 4 []) Source Public Optional .false.)}) log_io_error [(Var 5 self) (Var 5 code) (Var 5 filename) (Var 5 unit)] [] [] () Source Public Implementation () .false. .false. .false.), logger_type: (DerivedType (SymbolTable 3 {add_log_file: (ClassProcedure 3 add_log_file add_log_file 2 add_log_file Source), log_io_error: (ClassProcedure 3 log_io_error log_io_error 2 log_io_error Source)}) logger_type [] Source Public ())}) stdlib_logger [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {kwargs_02: (Program (SymbolTable 6 {}) kwargs_02 [] []), stdlib_logger: (Module (SymbolTable 2 {add_log_file: (Function (SymbolTable 4 {filename: (Variable 4 filename In () () Default (Character 1 -1 () []) Source Public Required .false.), self: (Variable 4 self InOut () () Default (Class 2 logger_type []) Source Public Required .false.), unit: (Variable 4 unit Out () () Default (Integer 4 []) Source Public Optional .false.)}) add_log_file [(Var 4 self) (Var 4 filename) (Var 4 unit)] [] [(SubroutineCall 3 log_io_error () [((IntegerConstant 1 (Integer 4 []))) ((Var 4 filename)) ((Var 4 unit))] (Var 4 self))] () Source Public Implementation () .false. .false. .false. .false.), log_io_error: (Function (SymbolTable 5 {code: (Variable 5 code In () () Default (Integer 4 []) Source Public Required .false.), filename: (Variable 5 filename In () () Default (Character 1 -1 () []) Source Public Optional .false.), self: (Variable 5 self InOut () () Default (Class 2 logger_type []) Source Public Required .false.), unit: (Variable 5 unit Out () () Default (Integer 4 []) Source Public Optional .false.)}) log_io_error [(Var 5 self) (Var 5 code) (Var 5 filename) (Var 5 unit)] [] [] () Source Public Implementation () .false. .false. .false. .false.), logger_type: (DerivedType (SymbolTable 3 {add_log_file: (ClassProcedure 3 add_log_file add_log_file 2 add_log_file Source), log_io_error: (ClassProcedure 3 log_io_error log_io_error 2 log_io_error Source)}) logger_type [] Source Public ())}) stdlib_logger [] .false. .false.)}) []) diff --git a/tests/reference/asr-loop_test1-716ccb0.json b/tests/reference/asr-loop_test1-716ccb0.json index 941a92b694..41b04a7dad 100644 --- a/tests/reference/asr-loop_test1-716ccb0.json +++ b/tests/reference/asr-loop_test1-716ccb0.json @@ -2,12 +2,12 @@ "basename": "asr-loop_test1-716ccb0", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/loop_test1.f", - "infile_hash": "b1b463bff050f345f0ec7c8b396834af2a9f39e99bd01619e3a9b13b", + "infile_hash": "28554b460ef639d9409b03e295744cb64644d54463dc6b6635b48119", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-loop_test1-716ccb0.stderr", - "stderr_hash": "afb2f1653bd044235c5fc76059b9ecaca1c5fd0659d0aa4e9340422a", - "returncode": 2 + "stdout": "asr-loop_test1-716ccb0.stdout", + "stdout_hash": "f82496dd80a07b822f56ba095b1d2e7d6bfdbc6c390b60d5802c2dcc", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-loop_test1-716ccb0.stderr b/tests/reference/asr-loop_test1-716ccb0.stderr deleted file mode 100644 index 59f0d62e7c..0000000000 --- a/tests/reference/asr-loop_test1-716ccb0.stderr +++ /dev/null @@ -1,9 +0,0 @@ -semantic error: Variable 'i' is not declared - --> tests/loop_test1.f:4:7 - 13:12 - | - 4 | DO 330 I=1,KP - | ^^^^^^^^^^^^^... -... - | -13 | end program - | ...^^^^^^^^^^^^ 'i' is undeclared diff --git a/tests/reference/asr-loop_test1-716ccb0.stdout b/tests/reference/asr-loop_test1-716ccb0.stdout new file mode 100644 index 0000000000..90d67a4451 --- /dev/null +++ b/tests/reference/asr-loop_test1-716ccb0.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {main: (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.), kp: (Variable 2 kp Local () () Default (Integer 4 []) Source Public Required .false.)}) main [] [(= (Var 2 kp) (IntegerConstant 10 (Integer 4 [])) ()) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (Var 2 kp) ()) [(DoLoop ((Var 2 j) (IntegerBinOp (Var 2 i) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) (Var 2 kp) ()) [(If (IntegerCompare (IntegerConstant 0 (Integer 4 [])) Gt (IntegerConstant 1 (Integer 4 [])) (Logical 4 []) (LogicalConstant .false. (Logical 4 []))) [(Print () [(Var 2 i) (Var 2 j)] () ())] [(Print () [(Var 2 j) (Var 2 i)] () ())]) (GoToTarget 320)]) (GoToTarget 330)])])}) []) diff --git a/tests/reference/asr-loop_test2-82d82ea.json b/tests/reference/asr-loop_test2-82d82ea.json index ba167c024a..fc476d0594 100644 --- a/tests/reference/asr-loop_test2-82d82ea.json +++ b/tests/reference/asr-loop_test2-82d82ea.json @@ -2,12 +2,12 @@ "basename": "asr-loop_test2-82d82ea", "cmd": "lfortran --fixed-form --show-asr --no-color {infile} -o {outfile}", "infile": "tests/loop_test2.f", - "infile_hash": "800f4e8ee2865e732235a58657bdd9e9dc28bf18f3dfa08c99b5d61c", + "infile_hash": "eeca40e0ea1de861bd50394bb8dd9b8ffca564f6d72b55497c601fac", "outfile": null, "outfile_hash": null, - "stdout": null, - "stdout_hash": null, - "stderr": "asr-loop_test2-82d82ea.stderr", - "stderr_hash": "55260b0a3d60cc50dfe8cc520bee51e9db77bcab2014e61a447fe70a", - "returncode": 2 + "stdout": "asr-loop_test2-82d82ea.stdout", + "stdout_hash": "394e360e1d900a29d04e85a645b294e2ec91741d1eb9b34bc09ad6b4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 } \ No newline at end of file diff --git a/tests/reference/asr-loop_test2-82d82ea.stderr b/tests/reference/asr-loop_test2-82d82ea.stderr deleted file mode 100644 index 62ac44ed75..0000000000 --- a/tests/reference/asr-loop_test2-82d82ea.stderr +++ /dev/null @@ -1,9 +0,0 @@ -semantic error: Variable 'l1' is not declared - --> tests/loop_test2.f:9:7 - 18:12 - | - 9 | DO 140 L1 = 1,NQ - | ^^^^^^^^^^^^^^^^... -... - | -18 | indx = 1 - | ...^^^^^^^^^^^^ 'l1' is undeclared diff --git a/tests/reference/asr-loop_test2-82d82ea.stdout b/tests/reference/asr-loop_test2-82d82ea.stdout new file mode 100644 index 0000000000..e221e20e89 --- /dev/null +++ b/tests/reference/asr-loop_test2-82d82ea.stdout @@ -0,0 +1 @@ +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {indx: (Variable 2 indx Local () () Default (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local () () Default (Integer 4 []) Source Public Required .false.), l1: (Variable 2 l1 Local () () Default (Integer 4 []) Source Public Required .false.), l2: (Variable 2 l2 Local () () Default (Integer 4 []) Source Public Required .false.), m: (Variable 2 m Local () () Default (Integer 4 []) Source Public Required .false.), nq: (Variable 2 nq Local () () Default (Integer 4 []) Source Public Required .false.), v: (Variable 2 v Local () () Default (Real 4 []) Source Public Required .false.), ve: (Variable 2 ve Local () () Default (Real 4 []) Source Public Required .false.), vev: (Variable 2 vev Local () () Default (Real 4 []) Source Public Required .false.), wrk5: (Variable 2 wrk5 Local () () Default (Real 4 []) Source Public Required .false.), zero: (Variable 2 zero Local () () Default (Real 4 []) Source Public Required .false.)}) f [] [] [(DoLoop ((Var 2 l1) (IntegerConstant 1 (Integer 4 [])) (Var 2 nq) ()) [(DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4 []) ()) (ArrayItem (Var 2 v) [(() (Var 2 indx) ()) (() (Var 2 j) ()) (() (Var 2 l1) ())] (Real 4 []) ()) ()) (GoToTarget 110)]) (DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4 []) ()) (ArrayItem (Var 2 wrk5) [(() (Var 2 j) ())] (Real 4 []) ()) ()) (GoToTarget 120)]) (GoToTarget 140)]) (= (Var 2 indx) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 zero) (Cast (RealConstant 0.000000 (Real 8 [])) RealToReal (Real 4 []) (RealConstant 0.000000 (Real 4 []))) ()) (DoLoop ((Var 2 l1) (IntegerConstant 1 (Integer 4 [])) (Var 2 nq) ()) [(DoLoop ((Var 2 l2) (IntegerConstant 1 (Integer 4 [])) (Var 2 l1) ()) [(= (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) (Var 2 zero) ()) (DoLoop ((Var 2 j) (IntegerConstant 1 (Integer 4 [])) (Var 2 m) ()) [(= (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) (RealBinOp (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) Add (RealBinOp (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l1) ()) (() (Var 2 j) ())] (Real 4 []) ()) Mul (ArrayItem (Var 2 ve) [(() (Var 2 indx) ()) (() (Var 2 l2) ()) (() (Var 2 j) ())] (Real 4 []) ()) (Real 4 []) ()) (Real 4 []) ()) ()) (GoToTarget 210)]) (= (ArrayItem (Var 2 vev) [(() (Var 2 l2) ()) (() (Var 2 l1) ())] (Real 4 []) ()) (ArrayItem (Var 2 vev) [(() (Var 2 l1) ()) (() (Var 2 l2) ())] (Real 4 []) ()) ()) (GoToTarget 220)]) (GoToTarget 230)]) (Return)] () Source Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/asr-loop_unroll_small-13135c0.json b/tests/reference/asr-loop_unroll_small-13135c0.json index c6dc8a4cae..1b0c0866e5 100644 --- a/tests/reference/asr-loop_unroll_small-13135c0.json +++ b/tests/reference/asr-loop_unroll_small-13135c0.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-loop_unroll_small-13135c0.stdout", - "stdout_hash": "81a9a0d71108fda0829338b7b3308418cac81ad79f12a6e3b38bc8c1", + "stdout_hash": "4d8039cf564d13d2a3bd36327bf92d60262966ad430e0cc88ece8776", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-loop_unroll_small-13135c0.stdout b/tests/reference/asr-loop_unroll_small-13135c0.stdout index 33489d7920..fdb9a7f5be 100644 --- a/tests/reference/asr-loop_unroll_small-13135c0.stdout +++ b/tests/reference/asr-loop_unroll_small-13135c0.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {loop_unroll_small: (Program (SymbolTable 2 {array: (Variable 2 array Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), first: (Variable 2 first Local () () Default (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), last: (Variable 2 last Local () () Default (Integer 4 []) Source Public Required .false.), print_subrout: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) print_subrout [(Var 3 x)] [] [(Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.)}) loop_unroll_small [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 first) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 last) (IntegerConstant 4 (Integer 4 [])) ()) (DoLoop ((Var 2 i) (Var 2 first) (Var 2 last) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (IntegerBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) Add (Var 2 i) (Integer 4 []) ()) ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (SubroutineCall 2 print_subrout () [((Var 2 x))] ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (If (IntegerCompare (Var 2 x) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 i) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])}) []) +(TranslationUnit (SymbolTable 1 {loop_unroll_small: (Program (SymbolTable 2 {array: (Variable 2 array Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), first: (Variable 2 first Local () () Default (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), last: (Variable 2 last Local () () Default (Integer 4 []) Source Public Required .false.), print_subrout: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) print_subrout [(Var 3 x)] [] [(Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.)}) loop_unroll_small [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 first) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 last) (IntegerConstant 4 (Integer 4 [])) ()) (DoLoop ((Var 2 i) (Var 2 first) (Var 2 last) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (IntegerBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) Add (Var 2 i) (Integer 4 []) ()) ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (SubroutineCall 2 print_subrout () [((Var 2 x))] ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (If (IntegerCompare (Var 2 x) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 i) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])}) []) diff --git a/tests/reference/asr-modules_01-3535389.json b/tests/reference/asr-modules_01-3535389.json index ba42444227..2b09765715 100644 --- a/tests/reference/asr-modules_01-3535389.json +++ b/tests/reference/asr-modules_01-3535389.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_01-3535389.stdout", - "stdout_hash": "00f179cc510d7e1260b82c74777d4583edfbfba6502d2408700a9f46", + "stdout_hash": "70aa2fe6abc4e622241e81f248d33229a9f60214d982f7ca17560aed", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_01-3535389.stdout b/tests/reference/asr-modules_01-3535389.stdout index 2299be7cfe..dc3cae1666 100644 --- a/tests/reference/asr-modules_01-3535389.stdout +++ b/tests/reference/asr-modules_01-3535389.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a_01: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false.)}) a_01 [] .false. .false.), modules_01: (Program (SymbolTable 4 {b: (ExternalSymbol 4 b 2 b a_01 [] b Public)}) modules_01 [a_01] [(SubroutineCall 4 b () [] ())])}) []) +(TranslationUnit (SymbolTable 1 {a_01: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) a_01 [] .false. .false.), modules_01: (Program (SymbolTable 4 {b: (ExternalSymbol 4 b 2 b a_01 [] b Public)}) modules_01 [a_01] [(SubroutineCall 4 b () [] ())])}) []) diff --git a/tests/reference/asr-modules_02-74be421.json b/tests/reference/asr-modules_02-74be421.json index ec697f262a..8c815fab11 100644 --- a/tests/reference/asr-modules_02-74be421.json +++ b/tests/reference/asr-modules_02-74be421.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_02-74be421.stdout", - "stdout_hash": "b1154a5ce8c10829f67343f0ad9ae97f09264051c6e5a06fe9f63eef", + "stdout_hash": "35b67870863e83fedd31c9ae8d5b69a8369404e31758f8e788dae1f7", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_02-74be421.stdout b/tests/reference/asr-modules_02-74be421.stdout index b4471062f7..fb786e0a8b 100644 --- a/tests/reference/asr-modules_02-74be421.stdout +++ b/tests/reference/asr-modules_02-74be421.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a_02: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false.)}) a_02 [] .false. .false.), c_02: (Module (SymbolTable 4 {d: (Function (SymbolTable 5 {}) d [] [] [(Print () [(StringConstant "d()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false.), e: (Function (SymbolTable 6 {}) e [] [] [(Print () [(StringConstant "e()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false.)}) c_02 [] .false. .false.), modules_02: (Program (SymbolTable 7 {b: (ExternalSymbol 7 b 2 b a_02 [] b Public), e: (ExternalSymbol 7 e 4 e c_02 [] e Public), x: (ExternalSymbol 7 x 4 d c_02 [] d Public)}) modules_02 [a_02 c_02] [(SubroutineCall 7 b () [] ()) (SubroutineCall 7 x () [] ()) (SubroutineCall 7 e () [] ())])}) []) +(TranslationUnit (SymbolTable 1 {a_02: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) a_02 [] .false. .false.), c_02: (Module (SymbolTable 4 {d: (Function (SymbolTable 5 {}) d [] [] [(Print () [(StringConstant "d()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false. .false.), e: (Function (SymbolTable 6 {}) e [] [] [(Print () [(StringConstant "e()" (Character 1 3 () []))] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) c_02 [] .false. .false.), modules_02: (Program (SymbolTable 7 {b: (ExternalSymbol 7 b 2 b a_02 [] b Public), e: (ExternalSymbol 7 e 4 e c_02 [] e Public), x: (ExternalSymbol 7 x 4 d c_02 [] d Public)}) modules_02 [a_02 c_02] [(SubroutineCall 7 b () [] ()) (SubroutineCall 7 x () [] ()) (SubroutineCall 7 e () [] ())])}) []) diff --git a/tests/reference/asr-modules_03-54c2520.json b/tests/reference/asr-modules_03-54c2520.json index 836fce7cf5..814bf07fe3 100644 --- a/tests/reference/asr-modules_03-54c2520.json +++ b/tests/reference/asr-modules_03-54c2520.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_03-54c2520.stdout", - "stdout_hash": "f411d476b1a5b4541049c85c3299c194307f8e1a2259e752289cf82b", + "stdout_hash": "16abf66cad4edf8173bab375d05fb624f0958af6b901acbe1276ffc4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_03-54c2520.stdout b/tests/reference/asr-modules_03-54c2520.stdout index af9df024ec..b436f2decd 100644 --- a/tests/reference/asr-modules_03-54c2520.stdout +++ b/tests/reference/asr-modules_03-54c2520.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {}) print_vars [] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 2 priv)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 2 publ)] () ())] () Source Public Implementation () .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {}) print_vars [] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 2 priv)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 2 publ)] () ())] () Source Public Implementation () .false. .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_04-0d478be.json b/tests/reference/asr-modules_04-0d478be.json index c73ba46f93..4cb2ece981 100644 --- a/tests/reference/asr-modules_04-0d478be.json +++ b/tests/reference/asr-modules_04-0d478be.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_04-0d478be.stdout", - "stdout_hash": "f411d476b1a5b4541049c85c3299c194307f8e1a2259e752289cf82b", + "stdout_hash": "16abf66cad4edf8173bab375d05fb624f0958af6b901acbe1276ffc4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_04-0d478be.stdout b/tests/reference/asr-modules_04-0d478be.stdout index af9df024ec..b436f2decd 100644 --- a/tests/reference/asr-modules_04-0d478be.stdout +++ b/tests/reference/asr-modules_04-0d478be.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {}) print_vars [] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 2 priv)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 2 publ)] () ())] () Source Public Implementation () .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {access_vars: (Module (SymbolTable 2 {print_vars: (Function (SymbolTable 3 {}) print_vars [] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 2 priv)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 2 publ)] () ())] () Source Public Implementation () .false. .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_05-f939cc6.json b/tests/reference/asr-modules_05-f939cc6.json index d95de13740..001a11e446 100644 --- a/tests/reference/asr-modules_05-f939cc6.json +++ b/tests/reference/asr-modules_05-f939cc6.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_05-f939cc6.stdout", - "stdout_hash": "8a064c473731e37fc6eaed51be76a3a60278f236c17696045e300903", + "stdout_hash": "30b33593f44ced04f3c7bce004c1b82b28c3da5e61eeea8e81600264", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_05-f939cc6.stdout b/tests/reference/asr-modules_05-f939cc6.stdout index 3b8f4d6fb8..53ec73bd23 100644 --- a/tests/reference/asr-modules_05-f939cc6.stdout +++ b/tests/reference/asr-modules_05-f939cc6.stdout @@ -1 +1 @@ -(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.), b: (Variable 3 b In () () Default (Real 4 []) Source Private Required .false.), print_vars: (Variable 3 print_vars ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) print_vars [(Var 3 a) (Var 3 b)] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 3 a)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 3 b)] () ()) (= (Var 3 print_vars) (IntegerConstant 1 (Integer 4 [])) ())] (Var 3 print_vars) Source Private Implementation () .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) +(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.), b: (Variable 3 b In () () Default (Real 4 []) Source Private Required .false.), print_vars: (Variable 3 print_vars ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) print_vars [(Var 3 a) (Var 3 b)] [] [(Print () [(StringConstant "priv = " (Character 1 7 () [])) (Var 3 a)] () ()) (Print () [(StringConstant "publ = " (Character 1 7 () [])) (Var 3 b)] () ()) (= (Var 3 print_vars) (IntegerConstant 1 (Integer 4 [])) ())] (Var 3 print_vars) Source Private Implementation () .false. .false. .false. .false.), priv: (Variable 2 priv Local (RealConstant 1.500000 (Real 4 [])) () Save (Real 4 []) Source Private Required .false.), publ: (Variable 2 publ Local (RealConstant 2.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) access_vars [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_06-609dd30.json b/tests/reference/asr-modules_06-609dd30.json index 3c25252cb6..3aa6092c50 100644 --- a/tests/reference/asr-modules_06-609dd30.json +++ b/tests/reference/asr-modules_06-609dd30.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_06-609dd30.stdout", - "stdout_hash": "d03e6170844b1ab9b9b8da1f94bb69e63225bab76f8d4ec691ac907e", + "stdout_hash": "e39f66b7b55c57ef0a63ba4f875e889723a5194fad004066717873a4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_06-609dd30.stdout b/tests/reference/asr-modules_06-609dd30.stdout index fb90931a68..e033d7b15d 100644 --- a/tests/reference/asr-modules_06-609dd30.stdout +++ b/tests/reference/asr-modules_06-609dd30.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a_06: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 r) (IntegerConstant 5 (Integer 4 [])) ())] (Var 3 r) Source Public Implementation () .false. .false. .false.)}) a_06 [] .false. .false.), modules_06: (Program (SymbolTable 4 {b: (ExternalSymbol 4 b 2 b a_06 [] b Public), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.)}) modules_06 [a_06] [(= (Var 4 i) (FunctionCall 4 b () [] (Integer 4 []) () ()) ()) (Print () [(Var 4 i)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {a_06: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {r: (Variable 3 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 r) (IntegerConstant 5 (Integer 4 [])) ())] (Var 3 r) Source Public Implementation () .false. .false. .false. .false.)}) a_06 [] .false. .false.), modules_06: (Program (SymbolTable 4 {b: (ExternalSymbol 4 b 2 b a_06 [] b Public), i: (Variable 4 i Local () () Default (Integer 4 []) Source Public Required .false.)}) modules_06 [a_06] [(= (Var 4 i) (FunctionCall 4 b () [] (Integer 4 []) () ()) ()) (Print () [(Var 4 i)] () ())])}) []) diff --git a/tests/reference/asr-modules_06-821cc56.json b/tests/reference/asr-modules_06-821cc56.json index 8c80cafd25..e4165dd3b3 100644 --- a/tests/reference/asr-modules_06-821cc56.json +++ b/tests/reference/asr-modules_06-821cc56.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_06-821cc56.stdout", - "stdout_hash": "b28d1600e77962023c84a49d89a16212dda9ead7e411bee66c487c93", + "stdout_hash": "cda095f78cebaf792b69af7be947e8e851ded5ba85cb87ad18a81024", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_06-821cc56.stdout b/tests/reference/asr-modules_06-821cc56.stdout index 98836e82c2..0861780ab8 100644 --- a/tests/reference/asr-modules_06-821cc56.stdout +++ b/tests/reference/asr-modules_06-821cc56.stdout @@ -1 +1 @@ -(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.)}) a [] [] [(= (Var 5 a) (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Add (FunctionCall 4 b () [] (Integer 4 []) () ()) (Integer 4 []) ()) ())] (Var 5 a) Source Public Implementation () .false. .false. .false.), b: (ExternalSymbol 4 b 2 b modules_06_b [] b Private)}) modules_06_a [modules_06_b] .false. .false.), modules_06_b: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(= (Var 3 b) (IntegerConstant 5 (Integer 4 [])) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.)}) modules_06_b [] .false. .false.)}) []) +(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.)}) a [] [] [(= (Var 5 a) (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Add (FunctionCall 4 b () [] (Integer 4 []) () ()) (Integer 4 []) ()) ())] (Var 5 a) Source Public Implementation () .false. .false. .false. .false.), b: (ExternalSymbol 4 b 2 b modules_06_b [] b Private)}) modules_06_a [modules_06_b] .false. .false.), modules_06_b: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(= (Var 3 b) (IntegerConstant 5 (Integer 4 [])) ())] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.)}) modules_06_b [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_11-dd72b29.json b/tests/reference/asr-modules_11-dd72b29.json index e96dc2e9d4..9e24bfbeaf 100644 --- a/tests/reference/asr-modules_11-dd72b29.json +++ b/tests/reference/asr-modules_11-dd72b29.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_11-dd72b29.stdout", - "stdout_hash": "1887039a737483b33da3a009d1f75c4d29c00a7c566e3e73511ef250", + "stdout_hash": "2933123a2ead99b96a54443e659f37e76cefd61a22e0fe9a07fe89b4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_11-dd72b29.stdout b/tests/reference/asr-modules_11-dd72b29.stdout index 8a7abe0a79..2b0ffedeed 100644 --- a/tests/reference/asr-modules_11-dd72b29.stdout +++ b/tests/reference/asr-modules_11-dd72b29.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {access_externally: (Program (SymbolTable 4 {access_internally: (ExternalSymbol 4 access_internally 2 access_internally module_11 [] access_internally Public), i: (ExternalSymbol 4 i 2 i module_11 [] i Public), j: (ExternalSymbol 4 j 2 j module_11 [] j Public)}) access_externally [module_11] [(Print () [(StringConstant "j = " (Character 1 4 () [])) (Var 4 j)] () ()) (SubroutineCall 4 access_internally () [] ())]), module_11: (Module (SymbolTable 2 {access_internally: (Function (SymbolTable 3 {}) access_internally [] [] [(Print () [(StringConstant "i = " (Character 1 4 () [])) (Var 2 i)] () ())] () Source Public Implementation () .false. .false. .false.), i: (Variable 2 i Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) module_11 [] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {access_externally: (Program (SymbolTable 4 {access_internally: (ExternalSymbol 4 access_internally 2 access_internally module_11 [] access_internally Public), i: (ExternalSymbol 4 i 2 i module_11 [] i Public), j: (ExternalSymbol 4 j 2 j module_11 [] j Public)}) access_externally [module_11] [(Print () [(StringConstant "j = " (Character 1 4 () [])) (Var 4 j)] () ()) (SubroutineCall 4 access_internally () [] ())]), module_11: (Module (SymbolTable 2 {access_internally: (Function (SymbolTable 3 {}) access_internally [] [] [(Print () [(StringConstant "i = " (Character 1 4 () [])) (Var 2 i)] () ())] () Source Public Implementation () .false. .false. .false. .false.), i: (Variable 2 i Local (IntegerConstant 1 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), j: (Variable 2 j Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) module_11 [] .false. .false.)}) []) diff --git a/tests/reference/asr-modules_15b-09f8335.json b/tests/reference/asr-modules_15b-09f8335.json index 2a7d7a3798..f28c1a2f2c 100644 --- a/tests/reference/asr-modules_15b-09f8335.json +++ b/tests/reference/asr-modules_15b-09f8335.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-modules_15b-09f8335.stdout", - "stdout_hash": "fcb0a67ac4764012588ecef29174f8fb5307d30c125c868d1ea0dcd5", + "stdout_hash": "5a7f731a1a36937ed0c468e41fa5772370502f8f3dd912aded8e8087", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-modules_15b-09f8335.stdout b/tests/reference/asr-modules_15b-09f8335.stdout index c71439beef..a06cc5b589 100644 --- a/tests/reference/asr-modules_15b-09f8335.stdout +++ b/tests/reference/asr-modules_15b-09f8335.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), 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_float: (ExternalSymbol 2 c_float 4 c_float lfortran_intrinsic_iso_c_binding [] c_float Public), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int 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 64 {i: (Variable 64 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 64 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) call_fortran_f32 [(Var 64 i)] [] [] (Var 64 r) BindC Public Interface () .false. .false. .false.), call_fortran_f32_value: (Function (SymbolTable 65 {i: (Variable 65 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 65 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) call_fortran_f32_value [(Var 65 i)] [] [] (Var 65 r) BindC Public Interface () .false. .false. .false.), call_fortran_f64: (Function (SymbolTable 66 {i: (Variable 66 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 66 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) call_fortran_f64 [(Var 66 i)] [] [] (Var 66 r) BindC Public Interface () .false. .false. .false.), call_fortran_f64_value: (Function (SymbolTable 67 {i: (Variable 67 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 67 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) call_fortran_f64_value [(Var 67 i)] [] [] (Var 67 r) BindC Public Interface () .false. .false. .false.), call_fortran_i32: (Function (SymbolTable 60 {i: (Variable 60 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 60 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) call_fortran_i32 [(Var 60 i)] [] [] (Var 60 r) BindC Public Interface () .false. .false. .false.), call_fortran_i32_value: (Function (SymbolTable 61 {i: (Variable 61 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 61 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) call_fortran_i32_value [(Var 61 i)] [] [] (Var 61 r) BindC Public Interface () .false. .false. .false.), call_fortran_i64: (Function (SymbolTable 62 {i: (Variable 62 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 62 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) call_fortran_i64 [(Var 62 i)] [] [] (Var 62 r) BindC Public Interface () .false. .false. .false.), call_fortran_i64_value: (Function (SymbolTable 63 {i: (Variable 63 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 63 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) call_fortran_i64_value [(Var 63 i)] [] [] (Var 63 r) BindC Public Interface () .false. .false. .false.), f_double_complex_value_return: (Function (SymbolTable 40 {b: (Variable 40 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 40 r ReturnVar () () Default (Complex 8 []) BindC Public Required .false.)}) f_double_complex_value_return [(Var 40 b)] [] [] (Var 40 r) BindC Public Interface () .false. .false. .false.), f_float_complex_value_return: (Function (SymbolTable 39 {b: (Variable 39 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 39 r ReturnVar () () Default (Complex 4 []) BindC Public Required .false.)}) f_float_complex_value_return [(Var 39 b)] [] [] (Var 39 r) BindC Public Interface () .false. .false. .false.), f_int_double: (Function (SymbolTable 34 {a: (Variable 34 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 34 b In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 34 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double [(Var 34 a) (Var 34 b)] [] [] (Var 34 r) BindC Public Interface () .false. .false. .false.), f_int_double_complex: (Function (SymbolTable 36 {a: (Variable 36 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 36 b In () () Default (Complex 8 []) BindC Public Required .false.), r: (Variable 36 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_complex [(Var 36 a) (Var 36 b)] [] [] (Var 36 r) BindC Public Interface () .false. .false. .false.), f_int_double_complex_value: (Function (SymbolTable 38 {a: (Variable 38 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 38 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 38 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_complex_value [(Var 38 a) (Var 38 b)] [] [] (Var 38 r) BindC Public Interface () .false. .false. .false.), f_int_double_value: (Function (SymbolTable 42 {a: (Variable 42 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 42 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 42 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_value [(Var 42 a) (Var 42 b)] [] [] (Var 42 r) BindC Public Interface () .false. .false. .false.), f_int_double_value_name: (Function (SymbolTable 46 {a: (Variable 46 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 46 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 46 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_value_name [(Var 46 a) (Var 46 b)] [] [] (Var 46 r) BindC Public Interface "f_int_double_value" .false. .false. .false.), f_int_doublearray: (Function (SymbolTable 45 {b: (Variable 45 b In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (Var 45 n))]) BindC Public Required .false.), n: (Variable 45 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 45 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) f_int_doublearray [(Var 45 n) (Var 45 b)] [] [] (Var 45 r) BindC Public Interface () .false. .false. .false.), f_int_float: (Function (SymbolTable 33 {a: (Variable 33 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 33 b In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 33 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float [(Var 33 a) (Var 33 b)] [] [] (Var 33 r) BindC Public Interface () .false. .false. .false.), f_int_float_complex: (Function (SymbolTable 35 {a: (Variable 35 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 35 b In () () Default (Complex 4 []) BindC Public Required .false.), r: (Variable 35 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_complex [(Var 35 a) (Var 35 b)] [] [] (Var 35 r) BindC Public Interface () .false. .false. .false.), f_int_float_complex_value: (Function (SymbolTable 37 {a: (Variable 37 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 37 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 37 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_complex_value [(Var 37 a) (Var 37 b)] [] [] (Var 37 r) BindC Public Interface () .false. .false. .false.), f_int_float_value: (Function (SymbolTable 41 {a: (Variable 41 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 41 b In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 41 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_value [(Var 41 a) (Var 41 b)] [] [] (Var 41 r) BindC Public Interface () .false. .false. .false.), f_int_floatarray: (Function (SymbolTable 44 {b: (Variable 44 b In () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (Var 44 n))]) BindC Public Required .false.), n: (Variable 44 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 44 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) f_int_floatarray [(Var 44 n) (Var 44 b)] [] [] (Var 44 r) BindC Public Interface () .false. .false. .false.), f_int_intarray: (Function (SymbolTable 43 {b: (Variable 43 b In () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 43 n))]) BindC Public Required .false.), n: (Variable 43 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 43 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_intarray [(Var 43 n) (Var 43 b)] [] [] (Var 43 r) BindC Public Interface () .false. .false. .false.), f_string: (Function (SymbolTable 68 {r: (Variable 68 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 68 s In () () Default (Character 1 -1 () []) Source Public Required .false.)}) f_string [(Var 68 s)] [] [(= (Var 68 r) (FunctionCall 2 f_string0 () [((StringConcat (Var 68 s) (Var 2 c_null_char) (Character 1 0 () []) ()))] (Integer 4 []) () ()) ())] (Var 68 r) Source Public Implementation () .false. .false. .false.), f_string0: (Function (SymbolTable 59 {r: (Variable 59 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.), s: (Variable 59 s In () () Default (Character 1 1 () [(() ())]) BindC Public Required .false.)}) f_string0 [(Var 59 s)] [] [] (Var 59 r) BindC Public Interface "f_string" .false. .false. .false.), fortran_f32: (Function (SymbolTable 73 {i: (Variable 73 i In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 73 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) fortran_f32 [(Var 73 i)] [] [(= (Var 73 r) (RealBinOp (Var 73 i) Add (RealConstant 2.300000 (Real 4 [])) (Real 4 []) ()) ())] (Var 73 r) BindC Public Implementation () .false. .false. .false.), fortran_f32_value: (Function (SymbolTable 74 {i: (Variable 74 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 74 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) fortran_f32_value [(Var 74 i)] [] [(= (Var 74 r) (RealBinOp (Var 74 i) Add (RealConstant 2.300000 (Real 4 [])) (Real 4 []) ()) ())] (Var 74 r) BindC Public Implementation () .false. .false. .false.), fortran_f64: (Function (SymbolTable 75 {i: (Variable 75 i In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 75 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) fortran_f64 [(Var 75 i)] [] [(= (Var 75 r) (RealBinOp (Var 75 i) Add (RealConstant 2.300000 (Real 8 [])) (Real 8 []) ()) ())] (Var 75 r) BindC Public Implementation () .false. .false. .false.), fortran_f64_value: (Function (SymbolTable 76 {i: (Variable 76 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 76 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) fortran_f64_value [(Var 76 i)] [] [(= (Var 76 r) (RealBinOp (Var 76 i) Add (RealConstant 2.300000 (Real 8 [])) (Real 8 []) ()) ())] (Var 76 r) BindC Public Implementation () .false. .false. .false.), fortran_i32: (Function (SymbolTable 69 {i: (Variable 69 i In () () Default (Integer 4 []) BindC Public Required .false.), r: (Variable 69 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) fortran_i32 [(Var 69 i)] [] [(= (Var 69 r) (IntegerBinOp (Var 69 i) Add (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 69 r) BindC Public Implementation () .false. .false. .false.), fortran_i32_value: (Function (SymbolTable 70 {i: (Variable 70 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 70 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) fortran_i32_value [(Var 70 i)] [] [(= (Var 70 r) (IntegerBinOp (Var 70 i) Add (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 70 r) BindC Public Implementation () .false. .false. .false.), fortran_i64: (Function (SymbolTable 71 {i: (Variable 71 i In () () Default (Integer 8 []) BindC Public Required .false.), r: (Variable 71 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) fortran_i64 [(Var 71 i)] [] [(= (Var 71 r) (IntegerBinOp (Var 71 i) Add (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 2 (Integer 8 []))) (Integer 8 []) ()) ())] (Var 71 r) BindC Public Implementation () .false. .false. .false.), fortran_i64_value: (Function (SymbolTable 72 {i: (Variable 72 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 72 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) fortran_i64_value [(Var 72 i)] [] [(= (Var 72 r) (IntegerBinOp (Var 72 i) Add (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 2 (Integer 8 []))) (Integer 8 []) ()) ())] (Var 72 r) BindC Public Implementation () .false. .false. .false.), sub_int_double: (Function (SymbolTable 48 {a: (Variable 48 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 48 b In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 48 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double [(Var 48 a) (Var 48 b) (Var 48 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_complex: (Function (SymbolTable 50 {a: (Variable 50 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 50 b In () () Default (Complex 8 []) BindC Public Required .false.), r: (Variable 50 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_complex [(Var 50 a) (Var 50 b) (Var 50 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_complex_value: (Function (SymbolTable 54 {a: (Variable 54 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 54 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 54 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_complex_value [(Var 54 a) (Var 54 b) (Var 54 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_value: (Function (SymbolTable 52 {a: (Variable 52 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 52 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 52 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_value [(Var 52 a) (Var 52 b) (Var 52 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_double_value_name: (Function (SymbolTable 58 {a: (Variable 58 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 58 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 58 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_value_name [(Var 58 a) (Var 58 b) (Var 58 r)] [] [] () BindC Public Interface "sub_int_double_value" .false. .false. .false.), sub_int_doublearray: (Function (SymbolTable 57 {b: (Variable 57 b In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (Var 57 n))]) BindC Public Required .false.), n: (Variable 57 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 57 r Out () () Default (Real 8 []) BindC Public Required .false.)}) sub_int_doublearray [(Var 57 n) (Var 57 b) (Var 57 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float: (Function (SymbolTable 47 {a: (Variable 47 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 47 b In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 47 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float [(Var 47 a) (Var 47 b) (Var 47 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float_complex: (Function (SymbolTable 49 {a: (Variable 49 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 49 b In () () Default (Complex 4 []) BindC Public Required .false.), r: (Variable 49 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_complex [(Var 49 a) (Var 49 b) (Var 49 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float_complex_value: (Function (SymbolTable 53 {a: (Variable 53 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 53 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 53 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_complex_value [(Var 53 a) (Var 53 b) (Var 53 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_float_value: (Function (SymbolTable 51 {a: (Variable 51 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 51 b In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 51 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_value [(Var 51 a) (Var 51 b) (Var 51 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_floatarray: (Function (SymbolTable 56 {b: (Variable 56 b In () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (Var 56 n))]) BindC Public Required .false.), n: (Variable 56 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 56 r Out () () Default (Real 4 []) BindC Public Required .false.)}) sub_int_floatarray [(Var 56 n) (Var 56 b) (Var 56 r)] [] [] () BindC Public Interface () .false. .false. .false.), sub_int_intarray: (Function (SymbolTable 55 {b: (Variable 55 b In () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 55 n))]) BindC Public Required .false.), n: (Variable 55 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 55 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_intarray [(Var 55 n) (Var 55 b) (Var 55 r)] [] [] () BindC Public Interface () .false. .false. .false.)}) modules_15b [iso_c_binding] .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), 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_float: (ExternalSymbol 2 c_float 4 c_float lfortran_intrinsic_iso_c_binding [] c_float Public), c_int: (ExternalSymbol 2 c_int 4 c_int lfortran_intrinsic_iso_c_binding [] c_int 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 64 {i: (Variable 64 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 64 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) call_fortran_f32 [(Var 64 i)] [] [] (Var 64 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_f32_value: (Function (SymbolTable 65 {i: (Variable 65 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 65 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) call_fortran_f32_value [(Var 65 i)] [] [] (Var 65 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_f64: (Function (SymbolTable 66 {i: (Variable 66 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 66 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) call_fortran_f64 [(Var 66 i)] [] [] (Var 66 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_f64_value: (Function (SymbolTable 67 {i: (Variable 67 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 67 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) call_fortran_f64_value [(Var 67 i)] [] [] (Var 67 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_i32: (Function (SymbolTable 60 {i: (Variable 60 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 60 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) call_fortran_i32 [(Var 60 i)] [] [] (Var 60 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_i32_value: (Function (SymbolTable 61 {i: (Variable 61 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 61 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) call_fortran_i32_value [(Var 61 i)] [] [] (Var 61 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_i64: (Function (SymbolTable 62 {i: (Variable 62 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 62 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) call_fortran_i64 [(Var 62 i)] [] [] (Var 62 r) BindC Public Interface () .false. .false. .false. .false.), call_fortran_i64_value: (Function (SymbolTable 63 {i: (Variable 63 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 63 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) call_fortran_i64_value [(Var 63 i)] [] [] (Var 63 r) BindC Public Interface () .false. .false. .false. .false.), f_double_complex_value_return: (Function (SymbolTable 40 {b: (Variable 40 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 40 r ReturnVar () () Default (Complex 8 []) BindC Public Required .false.)}) f_double_complex_value_return [(Var 40 b)] [] [] (Var 40 r) BindC Public Interface () .false. .false. .false. .false.), f_float_complex_value_return: (Function (SymbolTable 39 {b: (Variable 39 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 39 r ReturnVar () () Default (Complex 4 []) BindC Public Required .false.)}) f_float_complex_value_return [(Var 39 b)] [] [] (Var 39 r) BindC Public Interface () .false. .false. .false. .false.), f_int_double: (Function (SymbolTable 34 {a: (Variable 34 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 34 b In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 34 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double [(Var 34 a) (Var 34 b)] [] [] (Var 34 r) BindC Public Interface () .false. .false. .false. .false.), f_int_double_complex: (Function (SymbolTable 36 {a: (Variable 36 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 36 b In () () Default (Complex 8 []) BindC Public Required .false.), r: (Variable 36 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_complex [(Var 36 a) (Var 36 b)] [] [] (Var 36 r) BindC Public Interface () .false. .false. .false. .false.), f_int_double_complex_value: (Function (SymbolTable 38 {a: (Variable 38 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 38 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 38 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_complex_value [(Var 38 a) (Var 38 b)] [] [] (Var 38 r) BindC Public Interface () .false. .false. .false. .false.), f_int_double_value: (Function (SymbolTable 42 {a: (Variable 42 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 42 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 42 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_value [(Var 42 a) (Var 42 b)] [] [] (Var 42 r) BindC Public Interface () .false. .false. .false. .false.), f_int_double_value_name: (Function (SymbolTable 46 {a: (Variable 46 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 46 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 46 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_double_value_name [(Var 46 a) (Var 46 b)] [] [] (Var 46 r) BindC Public Interface "f_int_double_value" .false. .false. .false. .false.), f_int_doublearray: (Function (SymbolTable 45 {b: (Variable 45 b In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (Var 45 n))]) BindC Public Required .false.), n: (Variable 45 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 45 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) f_int_doublearray [(Var 45 n) (Var 45 b)] [] [] (Var 45 r) BindC Public Interface () .false. .false. .false. .false.), f_int_float: (Function (SymbolTable 33 {a: (Variable 33 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 33 b In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 33 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float [(Var 33 a) (Var 33 b)] [] [] (Var 33 r) BindC Public Interface () .false. .false. .false. .false.), f_int_float_complex: (Function (SymbolTable 35 {a: (Variable 35 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 35 b In () () Default (Complex 4 []) BindC Public Required .false.), r: (Variable 35 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_complex [(Var 35 a) (Var 35 b)] [] [] (Var 35 r) BindC Public Interface () .false. .false. .false. .false.), f_int_float_complex_value: (Function (SymbolTable 37 {a: (Variable 37 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 37 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 37 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_complex_value [(Var 37 a) (Var 37 b)] [] [] (Var 37 r) BindC Public Interface () .false. .false. .false. .false.), f_int_float_value: (Function (SymbolTable 41 {a: (Variable 41 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 41 b In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 41 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_float_value [(Var 41 a) (Var 41 b)] [] [] (Var 41 r) BindC Public Interface () .false. .false. .false. .false.), f_int_floatarray: (Function (SymbolTable 44 {b: (Variable 44 b In () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (Var 44 n))]) BindC Public Required .false.), n: (Variable 44 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 44 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) f_int_floatarray [(Var 44 n) (Var 44 b)] [] [] (Var 44 r) BindC Public Interface () .false. .false. .false. .false.), f_int_intarray: (Function (SymbolTable 43 {b: (Variable 43 b In () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 43 n))]) BindC Public Required .false.), n: (Variable 43 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 43 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f_int_intarray [(Var 43 n) (Var 43 b)] [] [] (Var 43 r) BindC Public Interface () .false. .false. .false. .false.), f_string: (Function (SymbolTable 68 {r: (Variable 68 r ReturnVar () () Default (Integer 4 []) Source Public Required .false.), s: (Variable 68 s In () () Default (Character 1 -1 () []) Source Public Required .false.)}) f_string [(Var 68 s)] [] [(= (Var 68 r) (FunctionCall 2 f_string0 () [((StringConcat (Var 68 s) (Var 2 c_null_char) (Character 1 0 () []) ()))] (Integer 4 []) () ()) ())] (Var 68 r) Source Public Implementation () .false. .false. .false. .false.), f_string0: (Function (SymbolTable 59 {r: (Variable 59 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.), s: (Variable 59 s In () () Default (Character 1 1 () [(() ())]) BindC Public Required .false.)}) f_string0 [(Var 59 s)] [] [] (Var 59 r) BindC Public Interface "f_string" .false. .false. .false. .false.), fortran_f32: (Function (SymbolTable 73 {i: (Variable 73 i In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 73 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) fortran_f32 [(Var 73 i)] [] [(= (Var 73 r) (RealBinOp (Var 73 i) Add (RealConstant 2.300000 (Real 4 [])) (Real 4 []) ()) ())] (Var 73 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_f32_value: (Function (SymbolTable 74 {i: (Variable 74 i In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 74 r ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) fortran_f32_value [(Var 74 i)] [] [(= (Var 74 r) (RealBinOp (Var 74 i) Add (RealConstant 2.300000 (Real 4 [])) (Real 4 []) ()) ())] (Var 74 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_f64: (Function (SymbolTable 75 {i: (Variable 75 i In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 75 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) fortran_f64 [(Var 75 i)] [] [(= (Var 75 r) (RealBinOp (Var 75 i) Add (RealConstant 2.300000 (Real 8 [])) (Real 8 []) ()) ())] (Var 75 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_f64_value: (Function (SymbolTable 76 {i: (Variable 76 i In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 76 r ReturnVar () () Default (Real 8 []) BindC Public Required .false.)}) fortran_f64_value [(Var 76 i)] [] [(= (Var 76 r) (RealBinOp (Var 76 i) Add (RealConstant 2.300000 (Real 8 [])) (Real 8 []) ()) ())] (Var 76 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_i32: (Function (SymbolTable 69 {i: (Variable 69 i In () () Default (Integer 4 []) BindC Public Required .false.), r: (Variable 69 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) fortran_i32 [(Var 69 i)] [] [(= (Var 69 r) (IntegerBinOp (Var 69 i) Add (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 69 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_i32_value: (Function (SymbolTable 70 {i: (Variable 70 i In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 70 r ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) fortran_i32_value [(Var 70 i)] [] [(= (Var 70 r) (IntegerBinOp (Var 70 i) Add (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) ()) ())] (Var 70 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_i64: (Function (SymbolTable 71 {i: (Variable 71 i In () () Default (Integer 8 []) BindC Public Required .false.), r: (Variable 71 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) fortran_i64 [(Var 71 i)] [] [(= (Var 71 r) (IntegerBinOp (Var 71 i) Add (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 2 (Integer 8 []))) (Integer 8 []) ()) ())] (Var 71 r) BindC Public Implementation () .false. .false. .false. .false.), fortran_i64_value: (Function (SymbolTable 72 {i: (Variable 72 i In () () Default (Integer 8 []) BindC Public Required .true.), r: (Variable 72 r ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) fortran_i64_value [(Var 72 i)] [] [(= (Var 72 r) (IntegerBinOp (Var 72 i) Add (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 2 (Integer 8 []))) (Integer 8 []) ()) ())] (Var 72 r) BindC Public Implementation () .false. .false. .false. .false.), sub_int_double: (Function (SymbolTable 48 {a: (Variable 48 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 48 b In () () Default (Real 8 []) BindC Public Required .false.), r: (Variable 48 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double [(Var 48 a) (Var 48 b) (Var 48 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_double_complex: (Function (SymbolTable 50 {a: (Variable 50 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 50 b In () () Default (Complex 8 []) BindC Public Required .false.), r: (Variable 50 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_complex [(Var 50 a) (Var 50 b) (Var 50 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_double_complex_value: (Function (SymbolTable 54 {a: (Variable 54 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 54 b In () () Default (Complex 8 []) BindC Public Required .true.), r: (Variable 54 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_complex_value [(Var 54 a) (Var 54 b) (Var 54 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_double_value: (Function (SymbolTable 52 {a: (Variable 52 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 52 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 52 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_value [(Var 52 a) (Var 52 b) (Var 52 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_double_value_name: (Function (SymbolTable 58 {a: (Variable 58 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 58 b In () () Default (Real 8 []) BindC Public Required .true.), r: (Variable 58 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_double_value_name [(Var 58 a) (Var 58 b) (Var 58 r)] [] [] () BindC Public Interface "sub_int_double_value" .false. .false. .false. .false.), sub_int_doublearray: (Function (SymbolTable 57 {b: (Variable 57 b In () () Default (Real 8 [((IntegerConstant 1 (Integer 4 [])) (Var 57 n))]) BindC Public Required .false.), n: (Variable 57 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 57 r Out () () Default (Real 8 []) BindC Public Required .false.)}) sub_int_doublearray [(Var 57 n) (Var 57 b) (Var 57 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_float: (Function (SymbolTable 47 {a: (Variable 47 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 47 b In () () Default (Real 4 []) BindC Public Required .false.), r: (Variable 47 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float [(Var 47 a) (Var 47 b) (Var 47 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_float_complex: (Function (SymbolTable 49 {a: (Variable 49 a In () () Default (Integer 4 []) BindC Public Required .false.), b: (Variable 49 b In () () Default (Complex 4 []) BindC Public Required .false.), r: (Variable 49 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_complex [(Var 49 a) (Var 49 b) (Var 49 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_float_complex_value: (Function (SymbolTable 53 {a: (Variable 53 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 53 b In () () Default (Complex 4 []) BindC Public Required .true.), r: (Variable 53 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_complex_value [(Var 53 a) (Var 53 b) (Var 53 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_float_value: (Function (SymbolTable 51 {a: (Variable 51 a In () () Default (Integer 4 []) BindC Public Required .true.), b: (Variable 51 b In () () Default (Real 4 []) BindC Public Required .true.), r: (Variable 51 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_float_value [(Var 51 a) (Var 51 b) (Var 51 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_floatarray: (Function (SymbolTable 56 {b: (Variable 56 b In () () Default (Real 4 [((IntegerConstant 1 (Integer 4 [])) (Var 56 n))]) BindC Public Required .false.), n: (Variable 56 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 56 r Out () () Default (Real 4 []) BindC Public Required .false.)}) sub_int_floatarray [(Var 56 n) (Var 56 b) (Var 56 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.), sub_int_intarray: (Function (SymbolTable 55 {b: (Variable 55 b In () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (Var 55 n))]) BindC Public Required .false.), n: (Variable 55 n In () () Default (Integer 4 []) BindC Public Required .true.), r: (Variable 55 r Out () () Default (Integer 4 []) BindC Public Required .false.)}) sub_int_intarray [(Var 55 n) (Var 55 b) (Var 55 r)] [] [] () BindC Public Interface () .false. .false. .false. .false.)}) modules_15b [iso_c_binding] .false. .false.)}) []) diff --git a/tests/reference/asr-nested_01-290187e.json b/tests/reference/asr-nested_01-290187e.json index 55e4999abe..964e6e6045 100644 --- a/tests/reference/asr-nested_01-290187e.json +++ b/tests/reference/asr-nested_01-290187e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_01-290187e.stdout", - "stdout_hash": "8959dffd708da657c7bceb8b7694d90c8f08bfbd44bbc4ff2616a378", + "stdout_hash": "5898dcb43e5052edcb872642f8b5ac5044baeb62fb46759527438dba", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_01-290187e.stdout b/tests/reference/asr-nested_01-290187e.stdout index 52ca8441b6..c1c031e7a0 100644 --- a/tests/reference/asr-nested_01-290187e.stdout +++ b/tests/reference/asr-nested_01-290187e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), d: (Function (SymbolTable 4 {d: (Variable 4 d ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) d [] [] [(Print () [(StringConstant "d()" (Character 1 3 () []))] () ()) (= (Var 4 d) (IntegerConstant 1 (Integer 4 [])) ())] (Var 4 d) Source Public Implementation () .false. .false. .false.), e: (Variable 3 e Local () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 e) (FunctionCall 3 d () [] (Integer 4 []) () ()) ()) (= (Var 3 b) (IntegerConstant 0 (Integer 4 [])) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.)}) a [] .false. .false.), nested_01: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b a [] b Public), c: (Variable 5 c Local () () Default (Integer 4 []) Source Public Required .false.)}) nested_01 [a] [(= (Var 5 c) (FunctionCall 5 b () [] (Integer 4 []) () ()) ())])}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), d: (Function (SymbolTable 4 {d: (Variable 4 d ReturnVar () () Default (Integer 4 []) Source Public Required .false.)}) d [] [] [(Print () [(StringConstant "d()" (Character 1 3 () []))] () ()) (= (Var 4 d) (IntegerConstant 1 (Integer 4 [])) ())] (Var 4 d) Source Public Implementation () .false. .false. .false. .false.), e: (Variable 3 e Local () () Default (Integer 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 e) (FunctionCall 3 d () [] (Integer 4 []) () ()) ()) (= (Var 3 b) (IntegerConstant 0 (Integer 4 [])) ())] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.)}) a [] .false. .false.), nested_01: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b a [] b Public), c: (Variable 5 c Local () () Default (Integer 4 []) Source Public Required .false.)}) nested_01 [a] [(= (Var 5 c) (FunctionCall 5 b () [] (Integer 4 []) () ()) ())])}) []) diff --git a/tests/reference/asr-nested_02-8302041.json b/tests/reference/asr-nested_02-8302041.json index 7eb4841bf1..9d0c817bb1 100644 --- a/tests/reference/asr-nested_02-8302041.json +++ b/tests/reference/asr-nested_02-8302041.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_02-8302041.stdout", - "stdout_hash": "d0935d00e8dd53beba61ddd059a9d8ceeaed9fdaf28e1664ae790424", + "stdout_hash": "429e74d8dfe3faa014df23b6c6b8e13ce8fbe6d7f20ed1ef5078c27d", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_02-8302041.stdout b/tests/reference/asr-nested_02-8302041.stdout index 2a4f3f900d..e51af0c39e 100644 --- a/tests/reference/asr-nested_02-8302041.stdout +++ b/tests/reference/asr-nested_02-8302041.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ())] () Source Public Implementation () .false. .false. .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false.)}) a [] .false. .false.), nested_02: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b a [] b Public)}) nested_02 [a] [(SubroutineCall 5 b () [] ())])}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false. .false.)}) a [] .false. .false.), nested_02: (Program (SymbolTable 5 {b: (ExternalSymbol 5 b 2 b a [] b Public)}) nested_02 [a] [(SubroutineCall 5 b () [] ())])}) []) diff --git a/tests/reference/asr-nested_03-57ffed2.json b/tests/reference/asr-nested_03-57ffed2.json index 5d66b69fc4..326bfdd1c4 100644 --- a/tests/reference/asr-nested_03-57ffed2.json +++ b/tests/reference/asr-nested_03-57ffed2.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_03-57ffed2.stdout", - "stdout_hash": "de18ee12ec4ff0a8c2897879cb5410f053c7230e4be1efe382f3a217", + "stdout_hash": "61bfc2f70af2286aaca0562a7c8740824fa64de1dde9744bbdbbadaf", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_03-57ffed2.stdout b/tests/reference/asr-nested_03-57ffed2.stdout index bcdb3cd740..3e7a81a23d 100644 --- a/tests/reference/asr-nested_03-57ffed2.stdout +++ b/tests/reference/asr-nested_03-57ffed2.stdout @@ -1 +1 @@ -(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 () [] ())]), nested_03_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ()) (Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 3 x Local (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false.)}) nested_03_a [] .false. .false.)}) []) +(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 () [] ())]), nested_03_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ()) (Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 3 x Local (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 6.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) b [] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false. .false.)}) nested_03_a [] .false. .false.)}) []) diff --git a/tests/reference/asr-nested_04-8423f42.json b/tests/reference/asr-nested_04-8423f42.json index 2479de781b..02147b4754 100644 --- a/tests/reference/asr-nested_04-8423f42.json +++ b/tests/reference/asr-nested_04-8423f42.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_04-8423f42.stdout", - "stdout_hash": "0e3fe9033b1ec0c1a7ed271f53b6dac7382bcd398b2d99da2834a92f", + "stdout_hash": "0c9f64656f6672bff1a9663c9ee972ca0f4011ab5dffdc81a845f869", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_04-8423f42.stdout b/tests/reference/asr-nested_04-8423f42.stdout index 7a385d6d91..f067014a36 100644 --- a/tests/reference/asr-nested_04-8423f42.stdout +++ b/tests/reference/asr-nested_04-8423f42.stdout @@ -1 +1 @@ -(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.)}) nested_04 [nested_04_a] [(= (Var 5 test) (FunctionCall 5 b () [((IntegerConstant 5 (Integer 4 [])))] (Integer 4 []) () ()) ())]), nested_04_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), c: (Function (SymbolTable 4 {c: (Variable 4 c ReturnVar () () Default (Integer 4 []) Source Public Required .false.), z: (Variable 4 z In () () Default (Integer 4 []) Source Public Required .false.)}) c [(Var 4 z)] [] [(Print () [(Var 4 z)] () ()) (Print () [(Var 3 y)] () ()) (Print () [(Var 3 yy)] () ()) (= (Var 4 c) (Var 4 z) ())] (Var 4 c) Source Public Implementation () .false. .false. .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Integer 4 []) Source Public Required .false.), yy: (Variable 3 yy Local (RealConstant 6.600000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) b [(Var 3 x)] [] [(= (Var 3 y) (Var 3 x) ()) (Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 b) (FunctionCall 3 c () [((IntegerConstant 6 (Integer 4 [])))] (Integer 4 []) () ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.)}) nested_04_a [] .false. .false.)}) []) +(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.)}) nested_04 [nested_04_a] [(= (Var 5 test) (FunctionCall 5 b () [((IntegerConstant 5 (Integer 4 [])))] (Integer 4 []) () ()) ())]), nested_04_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), c: (Function (SymbolTable 4 {c: (Variable 4 c ReturnVar () () Default (Integer 4 []) Source Public Required .false.), z: (Variable 4 z In () () Default (Integer 4 []) Source Public Required .false.)}) c [(Var 4 z)] [] [(Print () [(Var 4 z)] () ()) (Print () [(Var 3 y)] () ()) (Print () [(Var 3 yy)] () ()) (= (Var 4 c) (Var 4 z) ())] (Var 4 c) Source Public Implementation () .false. .false. .false. .false.), x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Integer 4 []) Source Public Required .false.), yy: (Variable 3 yy Local (RealConstant 6.600000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) b [(Var 3 x)] [] [(= (Var 3 y) (Var 3 x) ()) (Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (= (Var 3 b) (FunctionCall 3 c () [((IntegerConstant 6 (Integer 4 [])))] (Integer 4 []) () ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.)}) nested_04_a [] .false. .false.)}) []) diff --git a/tests/reference/asr-nested_05-00beea9.json b/tests/reference/asr-nested_05-00beea9.json index 150f02cf09..e0213b7359 100644 --- a/tests/reference/asr-nested_05-00beea9.json +++ b/tests/reference/asr-nested_05-00beea9.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_05-00beea9.stdout", - "stdout_hash": "56d03558a30e23bcc8e7f4c290bf292265e7513e8f49755794ffc612", + "stdout_hash": "27265497ee3e7306b5ceefea3836d9a76f57ed595dd5896877328554", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_05-00beea9.stdout b/tests/reference/asr-nested_05-00beea9.stdout index 3321be3f3e..93779effad 100644 --- a/tests/reference/asr-nested_05-00beea9.stdout +++ b/tests/reference/asr-nested_05-00beea9.stdout @@ -1 +1 @@ -(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 () [] ())]), nested_05_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ()) (= (Var 3 x) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 3 y) (RealConstant 3.500000 (Real 4 [])) ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 3 x Local (IntegerConstant 6 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local (RealConstant 5.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) b [] [] [(Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ()) (SubroutineCall 3 c () [] ()) (Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ())] () Source Public Implementation () .false. .false. .false.)}) nested_05_a [] .false. .false.)}) []) +(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 () [] ())]), nested_05_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ()) (= (Var 3 x) (IntegerConstant 4 (Integer 4 [])) ()) (= (Var 3 y) (RealConstant 3.500000 (Real 4 [])) ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 3 x Local (IntegerConstant 6 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), y: (Variable 3 y Local (RealConstant 5.500000 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.)}) b [] [] [(Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ()) (SubroutineCall 3 c () [] ()) (Print () [(Var 3 x)] () ()) (Print () [(Var 3 y)] () ())] () Source Public Implementation () .false. .false. .false. .false.)}) nested_05_a [] .false. .false.)}) []) diff --git a/tests/reference/asr-nested_06-1d576ad.json b/tests/reference/asr-nested_06-1d576ad.json index 558f61f8af..ac909b99d5 100644 --- a/tests/reference/asr-nested_06-1d576ad.json +++ b/tests/reference/asr-nested_06-1d576ad.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-nested_06-1d576ad.stdout", - "stdout_hash": "e436488fff8597c7985eba75c6df638f3ea6ca92cc0b7e9eecf68843", + "stdout_hash": "e6a7da0634666e583738cbeb5a3748bd9085990643391491717014a4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-nested_06-1d576ad.stdout b/tests/reference/asr-nested_06-1d576ad.stdout index 33bda2408d..c306c51ad3 100644 --- a/tests/reference/asr-nested_06-1d576ad.stdout +++ b/tests/reference/asr-nested_06-1d576ad.stdout @@ -1 +1 @@ -(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 [])))] ())]), nested_06_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ()) (Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 3 x Unspecified () () Default (Real 4 []) Source Public Required .false.)}) b [(Var 3 x)] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false.)}) nested_06_a [] .false. .false.)}) []) +(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 [])))] ())]), nested_06_a: (Module (SymbolTable 2 {b: (Function (SymbolTable 3 {c: (Function (SymbolTable 4 {}) c [] [] [(Print () [(IntegerConstant 5 (Integer 4 []))] () ()) (Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 3 x Unspecified () () Default (Real 4 []) Source Public Required .false.)}) b [(Var 3 x)] [] [(Print () [(StringConstant "b()" (Character 1 3 () []))] () ()) (SubroutineCall 3 c () [] ())] () Source Public Implementation () .false. .false. .false. .false.)}) nested_06_a [] .false. .false.)}) []) diff --git a/tests/reference/asr-operator_overloading_01-9ec8e71.json b/tests/reference/asr-operator_overloading_01-9ec8e71.json index a9b4563d1e..f2a054f79c 100644 --- a/tests/reference/asr-operator_overloading_01-9ec8e71.json +++ b/tests/reference/asr-operator_overloading_01-9ec8e71.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_01-9ec8e71.stdout", - "stdout_hash": "928ed3ffcd78a2783a602e3db3efd2727a73990313353988eefd4c9e", + "stdout_hash": "8ef0207949e75821ff1c14e14800e976663644d9cdfa49d5546cf831", "stderr": "asr-operator_overloading_01-9ec8e71.stderr", "stderr_hash": "bc887b577bc8ccfc15f212c070a67ee8c67af8d343abdd0132e6b6fb", "returncode": 0 diff --git a/tests/reference/asr-operator_overloading_01-9ec8e71.stdout b/tests/reference/asr-operator_overloading_01-9ec8e71.stdout index ef98d4cf5f..e9fd82ec6f 100644 --- a/tests/reference/asr-operator_overloading_01-9ec8e71.stdout +++ b/tests/reference/asr-operator_overloading_01-9ec8e71.stdout @@ -1 +1 @@ -(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.), 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.), ~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 () [(StringConstant "T*T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Mul (Var 5 t) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T*F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Mul (Var 5 f) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F*T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Mul (Var 5 t) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F*F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Mul (Var 5 f) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T+T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Add (Var 5 t) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 t))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "T+F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Add (Var 5 f) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 f))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "F+T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Add (Var 5 t) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 t))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "F+F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Add (Var 5 f) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 f))] (Integer 4 []) () ()))] () ())]), 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.), log1: (Variable 4 log1 In () () Default (Logical 4 []) Source Public Required .false.), log2: (Variable 4 log2 In () () Default (Logical 4 []) Source Public Required .false.)}) bin_add [(Var 4 log1) (Var 4 log2)] [] [(If (LogicalBinOp (Var 4 log1) And (Var 4 log2) (Logical 4 []) ()) [(= (Var 4 bin_add) (IntegerConstant 2 (Integer 4 [])) ())] [(If (LogicalBinOp (LogicalNot (Var 4 log1) (Logical 4 []) ()) And (LogicalNot (Var 4 log2) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 4 bin_add) (IntegerConstant 0 (Integer 4 [])) ())] [(= (Var 4 bin_add) (IntegerConstant 1 (Integer 4 [])) ())])])] (Var 4 bin_add) Source Public Implementation () .false. .false. .false.), logical_and: (Function (SymbolTable 3 {log1: (Variable 3 log1 In () () Default (Logical 4 []) Source Public Required .false.), log2: (Variable 3 log2 In () () Default (Logical 4 []) Source Public Required .false.), logical_and: (Variable 3 logical_and ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) logical_and [(Var 3 log1) (Var 3 log2)] [] [(= (Var 3 logical_and) (LogicalBinOp (Var 3 log1) And (Var 3 log2) (Logical 4 []) ()) ())] (Var 3 logical_and) Source Public Implementation () .false. .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.)}) []) +(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.), 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.), ~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 () [(StringConstant "T*T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Mul (Var 5 t) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T*F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Mul (Var 5 f) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 t)) ((Var 5 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F*T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Mul (Var 5 t) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 t))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "F*F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Mul (Var 5 f) (Logical 4 []) () (FunctionCall 5 logical_and 5 ~mul [((Var 5 f)) ((Var 5 f))] (Logical 4 []) () ()))] () ()) (Print () [(StringConstant "T+T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Add (Var 5 t) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 t))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "T+F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 t) Add (Var 5 f) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 t)) ((Var 5 f))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "F+T:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Add (Var 5 t) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 t))] (Integer 4 []) () ()))] () ()) (Print () [(StringConstant "F+F:" (Character 1 4 () [])) (OverloadedBinOp (Var 5 f) Add (Var 5 f) (Logical 4 []) () (FunctionCall 5 bin_add 5 ~add [((Var 5 f)) ((Var 5 f))] (Integer 4 []) () ()))] () ())]), 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.), log1: (Variable 4 log1 In () () Default (Logical 4 []) Source Public Required .false.), log2: (Variable 4 log2 In () () Default (Logical 4 []) Source Public Required .false.)}) bin_add [(Var 4 log1) (Var 4 log2)] [] [(If (LogicalBinOp (Var 4 log1) And (Var 4 log2) (Logical 4 []) ()) [(= (Var 4 bin_add) (IntegerConstant 2 (Integer 4 [])) ())] [(If (LogicalBinOp (LogicalNot (Var 4 log1) (Logical 4 []) ()) And (LogicalNot (Var 4 log2) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 4 bin_add) (IntegerConstant 0 (Integer 4 [])) ())] [(= (Var 4 bin_add) (IntegerConstant 1 (Integer 4 [])) ())])])] (Var 4 bin_add) Source Public Implementation () .false. .false. .false. .false.), logical_and: (Function (SymbolTable 3 {log1: (Variable 3 log1 In () () Default (Logical 4 []) Source Public Required .false.), log2: (Variable 3 log2 In () () Default (Logical 4 []) Source Public Required .false.), logical_and: (Variable 3 logical_and ReturnVar () () Default (Logical 4 []) Source Public Required .false.)}) logical_and [(Var 3 log1) (Var 3 log2)] [] [(= (Var 3 logical_and) (LogicalBinOp (Var 3 log1) And (Var 3 log2) (Logical 4 []) ()) ())] (Var 3 logical_and) Source Public Implementation () .false. .false. .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.)}) []) diff --git a/tests/reference/asr-operator_overloading_02-6076a0f.json b/tests/reference/asr-operator_overloading_02-6076a0f.json index 82d919862d..e726227b20 100644 --- a/tests/reference/asr-operator_overloading_02-6076a0f.json +++ b/tests/reference/asr-operator_overloading_02-6076a0f.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_02-6076a0f.stdout", - "stdout_hash": "425953f6140879d86f8478c77c2ee4c43c947f87a8b28b53596dde91", + "stdout_hash": "149df4480d84d3fcd5fc97bbf81ab17966c81ba2fcc49b582550463c", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-operator_overloading_02-6076a0f.stdout b/tests/reference/asr-operator_overloading_02-6076a0f.stdout index 226cc878b8..5c5b0689ca 100644 --- a/tests/reference/asr-operator_overloading_02-6076a0f.stdout +++ b/tests/reference/asr-operator_overloading_02-6076a0f.stdout @@ -1 +1 @@ -(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.), 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.), ~assign: (CustomOperator 2 ~assign [2 logical_gets_integer] Public)}) overload_assignment_m [] .false. .false.)}) []) +(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.), 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.), ~assign: (CustomOperator 2 ~assign [2 logical_gets_integer] Public)}) overload_assignment_m [] .false. .false.)}) []) diff --git a/tests/reference/asr-operator_overloading_03-f7a6efe.json b/tests/reference/asr-operator_overloading_03-f7a6efe.json index 514531c181..7622206f73 100644 --- a/tests/reference/asr-operator_overloading_03-f7a6efe.json +++ b/tests/reference/asr-operator_overloading_03-f7a6efe.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "asr-operator_overloading_03-f7a6efe.stdout", - "stdout_hash": "f165faffe8381c5e87436aa30b05dac8294c3aff5b1697ba87c80ec9", + "stdout_hash": "da840fc76fb90b35aca0fe7a54b542a2bf47efb5f646147bcc013ec1", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/asr-operator_overloading_03-f7a6efe.stdout b/tests/reference/asr-operator_overloading_03-f7a6efe.stdout index 0f0fe82e01..2ab03b47a9 100644 --- a/tests/reference/asr-operator_overloading_03-f7a6efe.stdout +++ b/tests/reference/asr-operator_overloading_03-f7a6efe.stdout @@ -1 +1 @@ -(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.), 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.), ~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 () [(StringConstant "T>T:" (Character 1 4 () [])) (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 []) () ()))] () ()) (Print () [(StringConstant "T>F:" (Character 1 4 () [])) (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 []) () ()))] () ()) (Print () [(StringConstant "F>T:" (Character 1 4 () [])) (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 []) () ()))] () ()) (Print () [(StringConstant "F>F:" (Character 1 4 () [])) (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 []) () ()))] () ()) (Print () [(StringConstant "TT:" (Character 1 4 () [])) (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 []) () ()))] () ()) (Print () [(StringConstant "T>F:" (Character 1 4 () [])) (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 []) () ()))] () ()) (Print () [(StringConstant "F>T:" (Character 1 4 () [])) (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 []) () ()))] () ()) (Print () [(StringConstant "F>F:" (Character 1 4 () [])) (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 []) () ()))] () ()) (Print () [(StringConstant "T= s 1000000) [(GoTo 0 () 2 [] ())] [] () () ()) (Continue 1 ())] () ()) (Stop 0 () () ()) (Continue 2 ())] [])]) diff --git a/tests/reference/ast-fixed_form_goto_select-6cc9882.json b/tests/reference/ast-fixed_form_goto_select-6cc9882.json new file mode 100644 index 0000000000..2464f421c5 --- /dev/null +++ b/tests/reference/ast-fixed_form_goto_select-6cc9882.json @@ -0,0 +1,13 @@ +{ + "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": "22cfa063902cdebe326983d37828571b2f7d8420493d8b5ee12698bd", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-fixed_form_goto_select-6cc9882.stdout b/tests/reference/ast-fixed_form_goto_select-6cc9882.stdout new file mode 100644 index 0000000000..7b20119c0a --- /dev/null +++ b/tests/reference/ast-fixed_form_goto_select-6cc9882.stdout @@ -0,0 +1 @@ +(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(k [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(m [] [] () None ()) (n [] [] () None ())] ())] [(= 0 k 1 ()) (Print 100 () [(String "hello")] ()) (= 200 k (+ k 1) ()) (= 0 m 1 ()) (= 0 n 2 ()) (GoTo 0 () m [200 100] ()) (GoTo 0 () n [100 200] ())] [])]) diff --git a/tests/reference/ast-fixed_form_simple_continue-dbefb27.json b/tests/reference/ast-fixed_form_simple_continue-dbefb27.json new file mode 100644 index 0000000000..43656bdb00 --- /dev/null +++ b/tests/reference/ast-fixed_form_simple_continue-dbefb27.json @@ -0,0 +1,13 @@ +{ + "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": "e2814c25031e04c92830dd6c895f58f1f8265e596da5431b528063d4", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-fixed_form_simple_continue-dbefb27.stdout b/tests/reference/ast-fixed_form_simple_continue-dbefb27.stdout new file mode 100644 index 0000000000..8b9a5ed3a0 --- /dev/null +++ b/tests/reference/ast-fixed_form_simple_continue-dbefb27.stdout @@ -0,0 +1 @@ +(TranslationUnit [(Program implicit_program_lfortran () [] [] [] [(Continue 0 ())] [])]) diff --git a/tests/reference/ast-loop_test1-7800c18.json b/tests/reference/ast-loop_test1-7800c18.json index ef6e801d0f..2a4ad25620 100644 --- a/tests/reference/ast-loop_test1-7800c18.json +++ b/tests/reference/ast-loop_test1-7800c18.json @@ -2,11 +2,11 @@ "basename": "ast-loop_test1-7800c18", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test1.f", - "infile_hash": "b1b463bff050f345f0ec7c8b396834af2a9f39e99bd01619e3a9b13b", + "infile_hash": "28554b460ef639d9409b03e295744cb64644d54463dc6b6635b48119", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test1-7800c18.stdout", - "stdout_hash": "c4c6c1d9e7221e13153bed56652e362cfced6979674435ff66740b45", + "stdout_hash": "a233f33eaaeb901073742c4bcfc4f8ebe49b89960d40bcf27992a7cb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-loop_test1-7800c18.stdout b/tests/reference/ast-loop_test1-7800c18.stdout index f6160a9a19..93a60c30da 100644 --- a/tests/reference/ast-loop_test1-7800c18.stdout +++ b/tests/reference/ast-loop_test1-7800c18.stdout @@ -1 +1 @@ -(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(kp [] [] () None ())] ())] [(= 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 ())] () ())] [])]) +(TranslationUnit [(Program main () [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(kp [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(i [] [] () None ()) (j [] [] () None ())] ())] [(= 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 ())] () ())] [])]) diff --git a/tests/reference/ast-loop_test2-c76adc4.json b/tests/reference/ast-loop_test2-c76adc4.json index 49fb3b583d..a062edf3ef 100644 --- a/tests/reference/ast-loop_test2-c76adc4.json +++ b/tests/reference/ast-loop_test2-c76adc4.json @@ -2,11 +2,11 @@ "basename": "ast-loop_test2-c76adc4", "cmd": "lfortran --fixed-form --show-ast --no-color {infile} -o {outfile}", "infile": "tests/loop_test2.f", - "infile_hash": "800f4e8ee2865e732235a58657bdd9e9dc28bf18f3dfa08c99b5d61c", + "infile_hash": "eeca40e0ea1de861bd50394bb8dd9b8ffca564f6d72b55497c601fac", "outfile": null, "outfile_hash": null, "stdout": "ast-loop_test2-c76adc4.stdout", - "stdout_hash": "fde0f0b5c1d5e7378c90ee354a6982e062f4708c7669f4886b392c3f", + "stdout_hash": "5f59a25d9720073323dfbe851acf529f81d55e43e6a41162f7324dba", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/ast-loop_test2-c76adc4.stdout b/tests/reference/ast-loop_test2-c76adc4.stdout index cfbb4f3c44..2bc8075471 100644 --- a/tests/reference/ast-loop_test2-c76adc4.stdout +++ b/tests/reference/ast-loop_test2-c76adc4.stdout @@ -1 +1 @@ -(TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(nq [] [] () None ()) (m [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(wrk5 [] [] () None ()) (v [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(ve [] [] () None ()) (vev [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(zero [] [] () None ())] ())] [(DoLoop 0 () 140 l1 1 nq () [(DoLoop 0 () 110 j 1 m () [(= 0 (FuncCallOrArray wrk5 [] [(() j ())] [] []) (FuncCallOrArray v [] [(() indx ()) (() j ()) (() l1 ())] [] []) ()) (Continue 110 ())] () ()) (DoLoop 0 () 120 j 1 m () [(= 0 (FuncCallOrArray ve [] [(() indx ()) (() l1 ()) (() j ())] [] []) (FuncCallOrArray wrk5 [] [(() j ())] [] []) ()) (Continue 120 ())] () ()) (Continue 140 ())] () ()) (= 0 indx 1 ()) (= 0 zero (Real "0.0d00") ()) (DoLoop 0 () 230 l1 1 nq () [(DoLoop 0 () 220 l2 1 l1 () [(= 0 (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) zero ()) (DoLoop 0 () 210 j 1 m () [(= 0 (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) (+ (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) (* (FuncCallOrArray ve [] [(() indx ()) (() l1 ()) (() j ())] [] []) (FuncCallOrArray ve [] [(() indx ()) (() l2 ()) (() j ())] [] []))) ()) (Continue 210 ())] () ()) (= 0 (FuncCallOrArray vev [] [(() l2 ()) (() l1 ())] [] []) (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) ()) (Continue 220 ())] () ()) (Continue 230 ())] () ()) (Return 0 () ())] [])]) +(TranslationUnit [(Subroutine f [] [] () () [] [] [] [(Declaration (AttrType TypeInteger [] () None) [] [(nq [] [] () None ()) (m [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(wrk5 [] [] () None ()) (v [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(l1 [] [] () None ()) (j [] [] () None ()) (l2 [] [] () None ())] ()) (Declaration (AttrType TypeInteger [] () None) [] [(indx [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(ve [] [] () None ()) (vev [] [] () None ())] ()) (Declaration (AttrType TypeReal [] () None) [] [(zero [] [] () None ())] ())] [(DoLoop 0 () 140 l1 1 nq () [(DoLoop 0 () 110 j 1 m () [(= 0 (FuncCallOrArray wrk5 [] [(() j ())] [] []) (FuncCallOrArray v [] [(() indx ()) (() j ()) (() l1 ())] [] []) ()) (Continue 110 ())] () ()) (DoLoop 0 () 120 j 1 m () [(= 0 (FuncCallOrArray ve [] [(() indx ()) (() l1 ()) (() j ())] [] []) (FuncCallOrArray wrk5 [] [(() j ())] [] []) ()) (Continue 120 ())] () ()) (Continue 140 ())] () ()) (= 0 indx 1 ()) (= 0 zero (Real "0.0d00") ()) (DoLoop 0 () 230 l1 1 nq () [(DoLoop 0 () 220 l2 1 l1 () [(= 0 (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) zero ()) (DoLoop 0 () 210 j 1 m () [(= 0 (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) (+ (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) (* (FuncCallOrArray ve [] [(() indx ()) (() l1 ()) (() j ())] [] []) (FuncCallOrArray ve [] [(() indx ()) (() l2 ()) (() j ())] [] []))) ()) (Continue 210 ())] () ()) (= 0 (FuncCallOrArray vev [] [(() l2 ()) (() l1 ())] [] []) (FuncCallOrArray vev [] [(() l1 ()) (() l2 ())] [] []) ()) (Continue 220 ())] () ()) (Continue 230 ())] () ()) (Return 0 () ())] [])]) diff --git a/tests/reference/ast-parameter1-e3995e7.json b/tests/reference/ast-parameter1-e3995e7.json new file mode 100644 index 0000000000..b5d433b47c --- /dev/null +++ b/tests/reference/ast-parameter1-e3995e7.json @@ -0,0 +1,13 @@ +{ + "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": "3b843e32b127feaf38ac5407bfd75adf6752f6689167565025ee8235", + "stderr": null, + "stderr_hash": null, + "returncode": 0 +} \ No newline at end of file diff --git a/tests/reference/ast-parameter1-e3995e7.stdout b/tests/reference/ast-parameter1-e3995e7.stdout new file mode 100644 index 0000000000..ed63218d94 --- /dev/null +++ b/tests/reference/ast-parameter1-e3995e7.stdout @@ -0,0 +1 @@ +(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 ())] ())] [(= 0 s (FuncCallOrArray max [] [(() (FuncCallOrArray abs [] [(() three ())] [] []) ()) (() (FuncCallOrArray abs [] [(() two ())] [] []) ()) (() (FuncCallOrArray abs [] [(() p66 ())] [] []) ())] [] []) ())] [])]) diff --git a/tests/reference/cpp-types_01-dfa3d3c.json b/tests/reference/cpp-types_01-dfa3d3c.json index 0b75f1f637..4f48fe5e3e 100644 --- a/tests/reference/cpp-types_01-dfa3d3c.json +++ b/tests/reference/cpp-types_01-dfa3d3c.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-types_01-dfa3d3c.stdout", - "stdout_hash": "622d6ef6f80f6490afdcf4f687b6f83de69d6c7c91a9b86041ae0c96", + "stdout_hash": "81617b756fcfc39b98273db58f6ab4e27d2cc6195c4a407864613989", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-types_01-dfa3d3c.stdout b/tests/reference/cpp-types_01-dfa3d3c.stdout index 9b8fbf7649..ee4a902058 100644 --- a/tests/reference/cpp-types_01-dfa3d3c.stdout +++ b/tests/reference/cpp-types_01-dfa3d3c.stdout @@ -34,8 +34,8 @@ void main2() { r = 1.00000000000000000e+00; r = 1.50000000000000000e+00; r = 1.00000000000000000e+00; - r = (float)(2); - r = (float)(3); + r = (double)(2); + r = (double)(3); } } diff --git a/tests/reference/cpp-types_03-dc774f0.json b/tests/reference/cpp-types_03-dc774f0.json index 3b1f60c368..14345ad999 100644 --- a/tests/reference/cpp-types_03-dc774f0.json +++ b/tests/reference/cpp-types_03-dc774f0.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-types_03-dc774f0.stdout", - "stdout_hash": "335c163fc2ba7f5ffe1a415b9dc833f0f6ca65b06255200aab4cdcc4", + "stdout_hash": "799197b329173cae3c878bebb821e14066e0877d139743005159c678", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-types_03-dc774f0.stdout b/tests/reference/cpp-types_03-dc774f0.stdout index eb4a937250..c774579120 100644 --- a/tests/reference/cpp-types_03-dc774f0.stdout +++ b/tests/reference/cpp-types_03-dc774f0.stdout @@ -34,7 +34,7 @@ void main2() { float r; r = 1.50000000000000000e+00; std::cout << r << std::endl; - i = (int)(r); + i = (int32_t)(r); std::cout << i << std::endl; } diff --git a/tests/reference/cpp-types_05-06dea62.json b/tests/reference/cpp-types_05-06dea62.json index 541ccafbeb..af7bf94dbb 100644 --- a/tests/reference/cpp-types_05-06dea62.json +++ b/tests/reference/cpp-types_05-06dea62.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "cpp-types_05-06dea62.stdout", - "stdout_hash": "9412f352c472e811aa1688b8a381552959965f17d708318b627e201f", + "stdout_hash": "dec545721dedb9f1cb6f881988b09d15d17614ca8e3acbcc8864d412", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/cpp-types_05-06dea62.stdout b/tests/reference/cpp-types_05-06dea62.stdout index 0eaf124bcc..428606ad01 100644 --- a/tests/reference/cpp-types_05-06dea62.stdout +++ b/tests/reference/cpp-types_05-06dea62.stdout @@ -39,13 +39,13 @@ void main2() { r = (float)(1/2); r = 1.00000000000000000e+00/(float)(2); r = (float)(1)/ 2.00000000000000000e+00; - i = (int)( 1.00000000000000000e+00*(float)(2)); - i = (int)((float)(2)* 1.00000000000000000e+00); - i = (int)((float)(2)*((float)(3) + 1.00000000000000000e+00)); - i = (int)((float)(2)*( 3.00000000000000000e+00 - (float)(1))); + 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 = (int)( 1.00000000000000000e+00/(float)(2)); - i = (int)((float)(1)/ 2.00000000000000000e+00); + i = (int32_t)( 1.00000000000000000e+00/(float)(2)); + i = (int32_t)((float)(1)/ 2.00000000000000000e+00); } } diff --git a/tests/reference/llvm-allocate_02-7f23768.json b/tests/reference/llvm-allocate_02-7f23768.json index 11e11ed010..b0a8ebcc32 100644 --- a/tests/reference/llvm-allocate_02-7f23768.json +++ b/tests/reference/llvm-allocate_02-7f23768.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-allocate_02-7f23768.stdout", - "stdout_hash": "84081f1ab3444064e71790b31e00f5742b4505a761f7793d2e510c6d", + "stdout_hash": "f64534c160ed15379d46b23ef4d1cf991774472be33a06d1618cac32", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-allocate_02-7f23768.stdout b/tests/reference/llvm-allocate_02-7f23768.stdout index 9f4497b3a8..57722fb3ea 100644 --- a/tests/reference/llvm-allocate_02-7f23768.stdout +++ b/tests/reference/llvm-allocate_02-7f23768.stdout @@ -850,7 +850,7 @@ loop.body11: ; preds = %loop.head10 %633 = load i32*, i32** %632, align 8 %634 = getelementptr inbounds i32, i32* %633, i32 %628 %635 = load i32, i32* %634, align 4 - %636 = mul i32 %635, 2 + %636 = mul i32 2, %635 store i32 %636, i32* %619, align 4 %637 = load i32, i32* %"1_v", align 4 %638 = add i32 %637, 1 @@ -1012,7 +1012,7 @@ loop.body17: ; preds = %loop.head16 %767 = load i32*, i32** %766, align 8 %768 = getelementptr inbounds i32, i32* %767, i32 %762 %769 = load i32, i32* %768, align 4 - %770 = mul i32 %769, 2 + %770 = mul i32 2, %769 store i32 %770, i32* %753, align 4 %771 = load i32, i32* %"1_v", align 4 %772 = add i32 %771, 1 @@ -1174,7 +1174,7 @@ loop.body23: ; preds = %loop.head22 %901 = load i32*, i32** %900, align 8 %902 = getelementptr inbounds i32, i32* %901, i32 %896 %903 = load i32, i32* %902, align 4 - %904 = mul i32 %903, 2 + %904 = mul i32 2, %903 store i32 %904, i32* %887, align 4 %905 = load i32, i32* %"1_v", align 4 %906 = add i32 %905, 1 @@ -1336,7 +1336,7 @@ loop.body29: ; preds = %loop.head28 %1035 = load i32*, i32** %1034, align 8 %1036 = getelementptr inbounds i32, i32* %1035, i32 %1030 %1037 = load i32, i32* %1036, align 4 - %1038 = mul i32 %1037, 2 + %1038 = mul i32 2, %1037 store i32 %1038, i32* %1021, align 4 %1039 = load i32, i32* %"1_v", align 4 %1040 = add i32 %1039, 1 diff --git a/tests/reference/llvm-arrays_op_5-8426b5a.json b/tests/reference/llvm-arrays_op_5-8426b5a.json index b5292264a9..68dc7092b5 100644 --- a/tests/reference/llvm-arrays_op_5-8426b5a.json +++ b/tests/reference/llvm-arrays_op_5-8426b5a.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "llvm-arrays_op_5-8426b5a.stdout", - "stdout_hash": "e3db2a5fbefb1da00da17e5a352acdd04a29e5299e937c17facc3f70", + "stdout_hash": "0f53837b945a4d470c252ff763d4690695b55968162f97bdb5340ac7", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-arrays_op_5-8426b5a.stdout b/tests/reference/llvm-arrays_op_5-8426b5a.stdout index c683272487..2e3615eade 100644 --- a/tests/reference/llvm-arrays_op_5-8426b5a.stdout +++ b/tests/reference/llvm-arrays_op_5-8426b5a.stdout @@ -1391,50 +1391,50 @@ loop.body30: ; preds = %loop.head29 %727 = getelementptr %array.0, %array.0* %"~2_bin_op_res", i32 0, i32 0 %728 = load %complex_4*, %complex_4** %727, align 8 %729 = getelementptr inbounds %complex_4, %complex_4* %728, i32 %723 - %730 = load i32, i32* %"1_v", align 4 - %731 = load i32, i32* %"2_v", align 4 - %732 = load i32, i32* %"3_v", align 4 - %733 = getelementptr %array.0, %array.0* %"~1_implicit_cast_res", i32 0, i32 2 - %734 = load %dimension_descriptor*, %dimension_descriptor** %733, align 8 - %735 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %734, i32 0 - %736 = getelementptr %dimension_descriptor, %dimension_descriptor* %735, i32 0, i32 1 - %737 = load i32, i32* %736, align 4 - %738 = sub i32 %730, %737 - %739 = mul i32 1, %738 - %740 = add i32 0, %739 - %741 = getelementptr %dimension_descriptor, %dimension_descriptor* %735, i32 0, i32 2 - %742 = load i32, i32* %741, align 4 + %730 = alloca %complex_4, align 8 + %731 = getelementptr %complex_4, %complex_4* %730, i32 0, i32 0 + %732 = getelementptr %complex_4, %complex_4* %730, i32 0, i32 1 + store float 0.000000e+00, float* %731, align 4 + store float 1.000000e+00, float* %732, align 4 + %733 = load %complex_4, %complex_4* %730, align 4 + %734 = load i32, i32* %"1_v", align 4 + %735 = load i32, i32* %"2_v", align 4 + %736 = load i32, i32* %"3_v", align 4 + %737 = getelementptr %array.0, %array.0* %"~1_implicit_cast_res", i32 0, i32 2 + %738 = load %dimension_descriptor*, %dimension_descriptor** %737, align 8 + %739 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %738, i32 0 + %740 = getelementptr %dimension_descriptor, %dimension_descriptor* %739, i32 0, i32 1 + %741 = load i32, i32* %740, align 4 + %742 = sub i32 %734, %741 %743 = mul i32 1, %742 - %744 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %734, i32 1 - %745 = getelementptr %dimension_descriptor, %dimension_descriptor* %744, i32 0, i32 1 + %744 = add i32 0, %743 + %745 = getelementptr %dimension_descriptor, %dimension_descriptor* %739, i32 0, i32 2 %746 = load i32, i32* %745, align 4 - %747 = sub i32 %731, %746 - %748 = mul i32 %743, %747 - %749 = add i32 %740, %748 - %750 = getelementptr %dimension_descriptor, %dimension_descriptor* %744, i32 0, i32 2 - %751 = load i32, i32* %750, align 4 - %752 = mul i32 %743, %751 - %753 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %734, i32 2 - %754 = getelementptr %dimension_descriptor, %dimension_descriptor* %753, i32 0, i32 1 + %747 = mul i32 1, %746 + %748 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %738, i32 1 + %749 = getelementptr %dimension_descriptor, %dimension_descriptor* %748, i32 0, i32 1 + %750 = load i32, i32* %749, align 4 + %751 = sub i32 %735, %750 + %752 = mul i32 %747, %751 + %753 = add i32 %744, %752 + %754 = getelementptr %dimension_descriptor, %dimension_descriptor* %748, i32 0, i32 2 %755 = load i32, i32* %754, align 4 - %756 = sub i32 %732, %755 - %757 = mul i32 %752, %756 - %758 = add i32 %749, %757 - %759 = getelementptr %dimension_descriptor, %dimension_descriptor* %753, i32 0, i32 2 - %760 = load i32, i32* %759, align 4 - %761 = mul i32 %752, %760 - %762 = getelementptr %array.0, %array.0* %"~1_implicit_cast_res", i32 0, i32 0 - %763 = load %complex_4*, %complex_4** %762, align 8 - %764 = getelementptr inbounds %complex_4, %complex_4* %763, i32 %758 - %765 = load %complex_4, %complex_4* %764, align 4 - %766 = alloca %complex_4, align 8 - %767 = getelementptr %complex_4, %complex_4* %766, i32 0, i32 0 - %768 = getelementptr %complex_4, %complex_4* %766, i32 0, i32 1 - store float 0.000000e+00, float* %767, align 4 - store float 1.000000e+00, float* %768, align 4 - %769 = load %complex_4, %complex_4* %766, align 4 + %756 = mul i32 %747, %755 + %757 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %738, i32 2 + %758 = getelementptr %dimension_descriptor, %dimension_descriptor* %757, i32 0, i32 1 + %759 = load i32, i32* %758, align 4 + %760 = sub i32 %736, %759 + %761 = mul i32 %756, %760 + %762 = add i32 %753, %761 + %763 = getelementptr %dimension_descriptor, %dimension_descriptor* %757, i32 0, i32 2 + %764 = load i32, i32* %763, align 4 + %765 = mul i32 %756, %764 + %766 = getelementptr %array.0, %array.0* %"~1_implicit_cast_res", i32 0, i32 0 + %767 = load %complex_4*, %complex_4** %766, align 8 + %768 = getelementptr inbounds %complex_4, %complex_4* %767, i32 %762 + %769 = load %complex_4, %complex_4* %768, align 4 %770 = alloca %complex_4, align 8 - store %complex_4 %765, %complex_4* %770, align 4 + store %complex_4 %733, %complex_4* %770, align 4 %771 = alloca %complex_4, align 8 store %complex_4 %769, %complex_4* %771, align 4 %772 = alloca %complex_4, align 8 @@ -2517,50 +2517,50 @@ loop.body90: ; preds = %loop.head89 %1617 = getelementptr %array.0, %array.0* %"~7_bin_op_res", i32 0, i32 0 %1618 = load %complex_4*, %complex_4** %1617, align 8 %1619 = getelementptr inbounds %complex_4, %complex_4* %1618, i32 %1613 - %1620 = load i32, i32* %"1_v", align 4 - %1621 = load i32, i32* %"2_v", align 4 - %1622 = load i32, i32* %"3_v", align 4 - %1623 = getelementptr %array.0, %array.0* %"~6_implicit_cast_res", i32 0, i32 2 - %1624 = load %dimension_descriptor*, %dimension_descriptor** %1623, align 8 - %1625 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %1624, i32 0 - %1626 = getelementptr %dimension_descriptor, %dimension_descriptor* %1625, i32 0, i32 1 - %1627 = load i32, i32* %1626, align 4 - %1628 = sub i32 %1620, %1627 - %1629 = mul i32 1, %1628 - %1630 = add i32 0, %1629 - %1631 = getelementptr %dimension_descriptor, %dimension_descriptor* %1625, i32 0, i32 2 - %1632 = load i32, i32* %1631, align 4 + %1620 = alloca %complex_4, align 8 + %1621 = getelementptr %complex_4, %complex_4* %1620, i32 0, i32 0 + %1622 = getelementptr %complex_4, %complex_4* %1620, i32 0, i32 1 + store float 0.000000e+00, float* %1621, align 4 + store float 1.000000e+00, float* %1622, align 4 + %1623 = load %complex_4, %complex_4* %1620, align 4 + %1624 = load i32, i32* %"1_v", align 4 + %1625 = load i32, i32* %"2_v", align 4 + %1626 = load i32, i32* %"3_v", align 4 + %1627 = getelementptr %array.0, %array.0* %"~6_implicit_cast_res", i32 0, i32 2 + %1628 = load %dimension_descriptor*, %dimension_descriptor** %1627, align 8 + %1629 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %1628, i32 0 + %1630 = getelementptr %dimension_descriptor, %dimension_descriptor* %1629, i32 0, i32 1 + %1631 = load i32, i32* %1630, align 4 + %1632 = sub i32 %1624, %1631 %1633 = mul i32 1, %1632 - %1634 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %1624, i32 1 - %1635 = getelementptr %dimension_descriptor, %dimension_descriptor* %1634, i32 0, i32 1 + %1634 = add i32 0, %1633 + %1635 = getelementptr %dimension_descriptor, %dimension_descriptor* %1629, i32 0, i32 2 %1636 = load i32, i32* %1635, align 4 - %1637 = sub i32 %1621, %1636 - %1638 = mul i32 %1633, %1637 - %1639 = add i32 %1630, %1638 - %1640 = getelementptr %dimension_descriptor, %dimension_descriptor* %1634, i32 0, i32 2 - %1641 = load i32, i32* %1640, align 4 - %1642 = mul i32 %1633, %1641 - %1643 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %1624, i32 2 - %1644 = getelementptr %dimension_descriptor, %dimension_descriptor* %1643, i32 0, i32 1 + %1637 = mul i32 1, %1636 + %1638 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %1628, i32 1 + %1639 = getelementptr %dimension_descriptor, %dimension_descriptor* %1638, i32 0, i32 1 + %1640 = load i32, i32* %1639, align 4 + %1641 = sub i32 %1625, %1640 + %1642 = mul i32 %1637, %1641 + %1643 = add i32 %1634, %1642 + %1644 = getelementptr %dimension_descriptor, %dimension_descriptor* %1638, i32 0, i32 2 %1645 = load i32, i32* %1644, align 4 - %1646 = sub i32 %1622, %1645 - %1647 = mul i32 %1642, %1646 - %1648 = add i32 %1639, %1647 - %1649 = getelementptr %dimension_descriptor, %dimension_descriptor* %1643, i32 0, i32 2 - %1650 = load i32, i32* %1649, align 4 - %1651 = mul i32 %1642, %1650 - %1652 = getelementptr %array.0, %array.0* %"~6_implicit_cast_res", i32 0, i32 0 - %1653 = load %complex_4*, %complex_4** %1652, align 8 - %1654 = getelementptr inbounds %complex_4, %complex_4* %1653, i32 %1648 - %1655 = load %complex_4, %complex_4* %1654, align 4 - %1656 = alloca %complex_4, align 8 - %1657 = getelementptr %complex_4, %complex_4* %1656, i32 0, i32 0 - %1658 = getelementptr %complex_4, %complex_4* %1656, i32 0, i32 1 - store float 0.000000e+00, float* %1657, align 4 - store float 1.000000e+00, float* %1658, align 4 - %1659 = load %complex_4, %complex_4* %1656, align 4 + %1646 = mul i32 %1637, %1645 + %1647 = getelementptr inbounds %dimension_descriptor, %dimension_descriptor* %1628, i32 2 + %1648 = getelementptr %dimension_descriptor, %dimension_descriptor* %1647, i32 0, i32 1 + %1649 = load i32, i32* %1648, align 4 + %1650 = sub i32 %1626, %1649 + %1651 = mul i32 %1646, %1650 + %1652 = add i32 %1643, %1651 + %1653 = getelementptr %dimension_descriptor, %dimension_descriptor* %1647, i32 0, i32 2 + %1654 = load i32, i32* %1653, align 4 + %1655 = mul i32 %1646, %1654 + %1656 = getelementptr %array.0, %array.0* %"~6_implicit_cast_res", i32 0, i32 0 + %1657 = load %complex_4*, %complex_4** %1656, align 8 + %1658 = getelementptr inbounds %complex_4, %complex_4* %1657, i32 %1652 + %1659 = load %complex_4, %complex_4* %1658, align 4 %1660 = alloca %complex_4, align 8 - store %complex_4 %1655, %complex_4* %1660, align 4 + store %complex_4 %1623, %complex_4* %1660, align 4 %1661 = alloca %complex_4, align 8 store %complex_4 %1659, %complex_4* %1661, align 4 %1662 = alloca %complex_4, align 8 diff --git a/tests/reference/llvm-intrinsics_03-0771f1b.json b/tests/reference/llvm-intrinsics_03-0771f1b.json index 250c5ce7a9..bc783300e8 100644 --- a/tests/reference/llvm-intrinsics_03-0771f1b.json +++ b/tests/reference/llvm-intrinsics_03-0771f1b.json @@ -2,11 +2,11 @@ "basename": "llvm-intrinsics_03-0771f1b", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_03.f90", - "infile_hash": "eda277452cad2d7bc3ef98963677fc276c09ce4d517756982a0d921d", + "infile_hash": "8e3eaf17fa2610e5ebdf1fd94dbf2be8ff26f85160239bcec926e16f", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_03-0771f1b.stdout", - "stdout_hash": "f7dfdaf2d7428d3dcd95670bf5e124b654b1960268728a29b8ffc2a6", + "stdout_hash": "cac96dc91fc0d492d5f06133040f0bd9e967ac6a28876ae1d057b449", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-intrinsics_03-0771f1b.stdout b/tests/reference/llvm-intrinsics_03-0771f1b.stdout index 16c83e1bda..9603caa9fc 100644 --- a/tests/reference/llvm-intrinsics_03-0771f1b.stdout +++ b/tests/reference/llvm-intrinsics_03-0771f1b.stdout @@ -9,6 +9,7 @@ source_filename = "LFortran" @1 = private unnamed_addr constant [2 x i8] c" \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"%f%s\00", align 1 +@4 = private unnamed_addr constant [12 x i8] c"ERROR STOP\0A\00", align 1 declare i8* @__module_lfortran_intrinsic_builtin_char(i32*) @@ -27,6 +28,21 @@ return: ; preds = %.entry declare void @_lfortran_cpu_time(double*) +define double @__module_lfortran_intrinsic_math_dcos(double* %x) { +.entry: + %r = alloca double, align 8 + %0 = load double, double* %x, align 8 + %1 = call double @_lfortran_dcos(double %0) + store double %1, double* %r, align 8 + br label %return + +return: ; preds = %.entry + %2 = load double, double* %r, align 8 + ret double %2 +} + +declare double @_lfortran_dcos(double) + define void @__module_lfortran_intrinsic_math_dp_rand_num(double* %harvest) { .entry: call void @_lfortran_dp_rand_num(double* %harvest) @@ -86,14 +102,67 @@ return: ; preds = %.entry declare void @_lfortran_sp_rand_num(float*) +define double @__module_lfortran_intrinsic_math2_dabs(double* %x) { +.entry: + %r = alloca double, align 8 + %0 = load double, double* %x, align 8 + %1 = fcmp uge double %0, 0.000000e+00 + br i1 %1, label %then, label %else + +then: ; preds = %.entry + %2 = load double, double* %x, align 8 + store double %2, double* %r, align 8 + br label %ifcont + +else: ; preds = %.entry + %3 = load double, double* %x, align 8 + %4 = fsub double 0.000000e+00, %3 + store double %4, double* %r, align 8 + br label %ifcont + +ifcont: ; preds = %else, %then + br label %return + +return: ; preds = %ifcont + %5 = load double, double* %r, align 8 + ret double %5 +} + define i32 @main() { .entry: + %call_arg_value = alloca double, align 8 + %a = alloca double, align 8 + %r1 = alloca double, align 8 + %r2 = alloca double, align 8 %x = alloca float, align 4 store float 0xBFEFE8D5A0000000, float* %x, align 4 %0 = load float, float* %x, align 4 %1 = fpext float %0 to double call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), double %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0)) + store double 4.200000e+00, double* %a, align 8 + %2 = call double @__module_lfortran_intrinsic_math_dcos(double* %a) + store double %2, double* %r1, align 8 + store double 0xBFDF606EEC8AC71E, double* %r2, align 8 + %3 = load double, double* %r1, align 8 + %4 = load double, double* %r2, align 8 + %5 = fsub double %3, %4 + store double %5, double* %call_arg_value, align 8 + %6 = call double @__module_lfortran_intrinsic_math2_dabs(double* %call_arg_value) + %7 = fcmp ugt double %6, 1.000000e-15 + br i1 %7, label %then, label %else + +then: ; preds = %.entry + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([12 x i8], [12 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 ret i32 0 } declare void @_lfortran_printf(i8*, ...) + +declare void @exit(i32) diff --git a/tests/reference/llvm-intrinsics_06-15c0eef.json b/tests/reference/llvm-intrinsics_06-15c0eef.json index 65dd661750..cfd234be8a 100644 --- a/tests/reference/llvm-intrinsics_06-15c0eef.json +++ b/tests/reference/llvm-intrinsics_06-15c0eef.json @@ -2,11 +2,11 @@ "basename": "llvm-intrinsics_06-15c0eef", "cmd": "lfortran --no-color --show-llvm {infile} -o {outfile}", "infile": "tests/../integration_tests/intrinsics_06.f90", - "infile_hash": "159c10373053040b4614f7468175543b4735da80807fbb7ef9bad071", + "infile_hash": "45568686a8770f0612e168afdd5bfba81ef25b7ad61daf3ef5960d15", "outfile": null, "outfile_hash": null, "stdout": "llvm-intrinsics_06-15c0eef.stdout", - "stdout_hash": "673deaec3d1d437eeea9ec24758dab95a4c17226a9f8aefe78c229c4", + "stdout_hash": "10a5b5aca78d25e7ba6479383b48a13c890bd5c5791a92ed7e3ff7e6", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/llvm-intrinsics_06-15c0eef.stdout b/tests/reference/llvm-intrinsics_06-15c0eef.stdout index c600c182c5..60f84a2238 100644 --- a/tests/reference/llvm-intrinsics_06-15c0eef.stdout +++ b/tests/reference/llvm-intrinsics_06-15c0eef.stdout @@ -24,6 +24,9 @@ source_filename = "LFortran" @16 = private unnamed_addr constant [2 x i8] c" \00", align 1 @17 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1 @18 = private unnamed_addr constant [5 x i8] c"%f%s\00", align 1 +@19 = private unnamed_addr constant [2 x i8] c" \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"%f%s\00", align 1 declare i8* @__module_lfortran_intrinsic_builtin_char(i32*) @@ -42,6 +45,21 @@ return: ; preds = %.entry declare void @_lfortran_cpu_time(double*) +define double @__module_lfortran_intrinsic_math_datan(double* %x) { +.entry: + %r = alloca double, align 8 + %0 = load double, double* %x, align 8 + %1 = call double @_lfortran_datan(double %0) + store double %1, double* %r, align 8 + br label %return + +return: ; preds = %.entry + %2 = load double, double* %r, align 8 + ret double %2 +} + +declare double @_lfortran_datan(double) + define void @__module_lfortran_intrinsic_math_dp_rand_num(double* %harvest) { .entry: call void @_lfortran_dp_rand_num(double* %harvest) @@ -203,6 +221,10 @@ define i32 @main() { %10 = load float, float* %x, align 4 %11 = fpext float %10 to double call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @18, i32 0, i32 0), double %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @17, i32 0, i32 0)) + store float 1.000000e+00, float* %x, align 4 + %12 = load float, float* %x, align 4 + %13 = fpext float %12 to double + call void (i8*, ...) @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @21, i32 0, i32 0), double %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @20, i32 0, i32 0)) ret i32 0 } diff --git a/tests/reference/mod_to_asr-mod1-14-4253040.json b/tests/reference/mod_to_asr-mod1-14-4253040.json index 252cd44121..bc8a76b678 100644 --- a/tests/reference/mod_to_asr-mod1-14-4253040.json +++ b/tests/reference/mod_to_asr-mod1-14-4253040.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "mod_to_asr-mod1-14-4253040.stdout", - "stdout_hash": "dbf98ee7b349a534ad1d9ac6a26505274a34b71edf9728f764eab2ff", + "stdout_hash": "26e0b14558270c663e2b978bc32a7489e4505d1d19980f449c16e521", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/mod_to_asr-mod1-14-4253040.stdout b/tests/reference/mod_to_asr-mod1-14-4253040.stdout index 268c7ff6c0..66604b584a 100644 --- a/tests/reference/mod_to_asr-mod1-14-4253040.stdout +++ b/tests/reference/mod_to_asr-mod1-14-4253040.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f1: (Function (SymbolTable 2 {}) f1 [] [] [] () GFortranModule Public Interface () .false. .false. .false.), f2: (Function (SymbolTable 3 {}) f2 [] [] [] () GFortranModule Public Interface () .false. .false. .false.), f2b: (Function (SymbolTable 4 {}) f2b [] [] [] () GFortranModule Public Interface () .false. .false. .false.), f3: (Function (SymbolTable 5 {}) f3 [] [] [] () GFortranModule Public Interface () .false. .false. .false.), f3b: (Function (SymbolTable 6 {}) f3b [] [] [] () GFortranModule Public Interface () .false. .false. .false.), f4: (Function (SymbolTable 7 {}) f4 [] [] [] () GFortranModule Public Interface () .false. .false. .false.), f5b: (Function (SymbolTable 8 {}) f5b [] [] [] () GFortranModule Public Interface () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f1: (Function (SymbolTable 2 {}) f1 [] [] [] () GFortranModule Public Interface () .false. .false. .false. .false.), f2: (Function (SymbolTable 3 {}) f2 [] [] [] () GFortranModule Public Interface () .false. .false. .false. .false.), f2b: (Function (SymbolTable 4 {}) f2b [] [] [] () GFortranModule Public Interface () .false. .false. .false. .false.), f3: (Function (SymbolTable 5 {}) f3 [] [] [] () GFortranModule Public Interface () .false. .false. .false. .false.), f3b: (Function (SymbolTable 6 {}) f3b [] [] [] () GFortranModule Public Interface () .false. .false. .false. .false.), f4: (Function (SymbolTable 7 {}) f4 [] [] [] () GFortranModule Public Interface () .false. .false. .false. .false.), f5b: (Function (SymbolTable 8 {}) f5b [] [] [] () GFortranModule Public Interface () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/pass_flip_sign-flip_sign-16b288c.json b/tests/reference/pass_flip_sign-flip_sign-16b288c.json index 93489195b6..bea87b2cfe 100644 --- a/tests/reference/pass_flip_sign-flip_sign-16b288c.json +++ b/tests/reference/pass_flip_sign-flip_sign-16b288c.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_flip_sign-flip_sign-16b288c.stdout", - "stdout_hash": "ad289a3ead2f6cdaccfc48a3ded97fe1290da3f6fcb47ccf09e8e996", + "stdout_hash": "920af2c584fc2fc8c1513f6f93c44d315c38e94d06c279238617f448", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout b/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout index c03ac15ed9..422127c11b 100644 --- a/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout +++ b/tests/reference/pass_flip_sign-flip_sign-16b288c.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 92 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 92 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), flipsign@flipsigni32r32: (ExternalSymbol 2 flipsign@flipsigni32r32 288 flipsigni32r32 lfortran_intrinsic_optimization [] flipsigni32r32 Private), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), flipsign: (ExternalSymbol 1 flipsign 288 flipsign lfortran_intrinsic_optimization [] flipsign Private), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), lfortran_intrinsic_optimization: (IntrinsicModule lfortran_intrinsic_optimization)}) []) +(TranslationUnit (SymbolTable 1 {flip_sign: (Program (SymbolTable 2 {abs: (ExternalSymbol 2 abs 95 abs lfortran_intrinsic_math [] abs Private), abs@sabs: (ExternalSymbol 2 abs@sabs 95 sabs lfortran_intrinsic_math [] sabs Private), eps: (Variable 2 eps Local (RealConstant 0.000001 (Real 4 [])) () Save (Real 4 []) Source Public Required .false.), flipsign@flipsigni32r32: (ExternalSymbol 2 flipsign@flipsigni32r32 291 flipsigni32r32 lfortran_intrinsic_optimization [] flipsigni32r32 Private), modulo: (ExternalSymbol 2 modulo 4 modulo lfortran_intrinsic_math2 [] modulo Private), modulo@imodulo: (ExternalSymbol 2 modulo@imodulo 4 imodulo lfortran_intrinsic_math2 [] imodulo Private), number: (Variable 2 number Local () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 2 x Local () () Default (Real 4 []) Source Public Required .false.)}) flip_sign [] [(= (Var 2 number) (IntegerConstant 123 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealUnaryMinus (RealConstant 5.500000 (Real 4 [])) (Real 4 []) (RealConstant -5.500000 (Real 4 []))) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] []) (= (Var 2 number) (IntegerConstant 124 (Integer 4 [])) ()) (= (Var 2 x) (RealConstant 5.500000 (Real 4 [])) ()) (SubroutineCall 2 flipsign@flipsigni32r32 1 flipsign [((Var 2 number)) ((Var 2 x))] ()) (If (RealCompare (FunctionCall 2 abs@sabs 2 abs [((RealBinOp (Var 2 x) Sub (RealConstant 5.500000 (Real 4 [])) (Real 4 []) ()))] (Real 4 []) () ()) Gt (Var 2 eps) (Logical 4 []) ()) [(ErrorStop ())] [])]), flipsign: (ExternalSymbol 1 flipsign 291 flipsign lfortran_intrinsic_optimization [] flipsign Private), iso_c_binding: (IntrinsicModule lfortran_intrinsic_iso_c_binding), iso_fortran_env: (IntrinsicModule lfortran_intrinsic_iso_fortran_env), lfortran_intrinsic_builtin: (IntrinsicModule lfortran_intrinsic_builtin), lfortran_intrinsic_math: (IntrinsicModule lfortran_intrinsic_math), lfortran_intrinsic_math2: (IntrinsicModule lfortran_intrinsic_math2), lfortran_intrinsic_math3: (IntrinsicModule lfortran_intrinsic_math3), lfortran_intrinsic_optimization: (IntrinsicModule lfortran_intrinsic_optimization)}) []) diff --git a/tests/reference/pass_global_stmts-expr1-213371d.json b/tests/reference/pass_global_stmts-expr1-213371d.json index 63caff611d..40ca2cf150 100644 --- a/tests/reference/pass_global_stmts-expr1-213371d.json +++ b/tests/reference/pass_global_stmts-expr1-213371d.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr1-213371d.stdout", - "stdout_hash": "fc17dfcfd9cb969504a1f4d9eb0d0fbe643b6a6729483b0d77c2f6bf", + "stdout_hash": "53659a2725490ab5a6cfecb93e4fd053b2789ab6a053f43ebb08aa2e", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-expr1-213371d.stdout b/tests/reference/pass_global_stmts-expr1-213371d.stdout index c4c09a7946..a942f6bc9c 100644 --- a/tests/reference/pass_global_stmts-expr1-213371d.stdout +++ b/tests/reference/pass_global_stmts-expr1-213371d.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (IntegerConstant 5 (Integer 4 [])) ())] (Var 2 f1) BindC Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (IntegerConstant 5 (Integer 4 [])) ())] (Var 2 f1) BindC Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/pass_global_stmts-expr2-22f4149.json b/tests/reference/pass_global_stmts-expr2-22f4149.json index 90ac99aabc..e540949d83 100644 --- a/tests/reference/pass_global_stmts-expr2-22f4149.json +++ b/tests/reference/pass_global_stmts-expr2-22f4149.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr2-22f4149.stdout", - "stdout_hash": "a74d7190317f22ab189509e88219ea4c70012df68a586e7c4964f5ae", + "stdout_hash": "562026fc1a9766d912e09129b4b805f0bcfd405cc82255df6993cf92", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-expr2-22f4149.stdout b/tests/reference/pass_global_stmts-expr2-22f4149.stdout index 2c7c15d5fa..1898424be2 100644 --- a/tests/reference/pass_global_stmts-expr2-22f4149.stdout +++ b/tests/reference/pass_global_stmts-expr2-22f4149.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) ())] (Var 2 f1) BindC Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) ())] (Var 2 f1) BindC Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/pass_global_stmts-expr3-c9c0bd7.json b/tests/reference/pass_global_stmts-expr3-c9c0bd7.json index ad673d79a1..f26f81930f 100644 --- a/tests/reference/pass_global_stmts-expr3-c9c0bd7.json +++ b/tests/reference/pass_global_stmts-expr3-c9c0bd7.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr3-c9c0bd7.stdout", - "stdout_hash": "eb05538b8dd447f7a859b8f9e4c0b472481ccfb3b9ee316abc32b2d3", + "stdout_hash": "a4dabaeef293ea09cb7371e3f2a805bd92d1acaab58538397f97ffe4", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-expr3-c9c0bd7.stdout b/tests/reference/pass_global_stmts-expr3-c9c0bd7.stdout index bb4059b28b..6abe91c65c 100644 --- a/tests/reference/pass_global_stmts-expr3-c9c0bd7.stdout +++ b/tests/reference/pass_global_stmts-expr3-c9c0bd7.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Integer 4 []) BindC Public Required .false.), f2: (Variable 2 f2 Local () () Default (Integer 4 []) BindC Public Required .false.), f3: (Variable 2 f3 Local () () Default (Integer 4 []) BindC Public Required .false.), f4: (Variable 2 f4 Local () () Default (Integer 4 []) BindC Public Required .false.), f5: (Variable 2 f5 Local () () Default (Integer 4 []) BindC Public Required .false.), f6: (Variable 2 f6 Local () () Default (Integer 4 []) BindC Public Required .false.), f7: (Variable 2 f7 Local () () Default (Integer 4 []) BindC Public Required .false.), f8: (Variable 2 f8 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (IntegerConstant 5 (Integer 4 [])) ()) (= (Var 2 f2) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) ()) (= (Var 2 f3) (IntegerBinOp (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) Mul (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant 16 (Integer 4 []))) ()) (= (Var 2 f4) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant 6 (Integer 4 []))) (Integer 4 []) (IntegerConstant 11 (Integer 4 []))) ()) (= (Var 2 f5) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Sub (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 2 (Integer 4 []))) ()) (= (Var 2 f6) (IntegerBinOp (IntegerConstant 4 (Integer 4 [])) Pow (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 64 (Integer 4 []))) ()) (= (Var 2 f7) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) ()) (= (Var 2 f8) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) ())] (Var 2 f8) BindC Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Integer 4 []) BindC Public Required .false.), f2: (Variable 2 f2 Local () () Default (Integer 4 []) BindC Public Required .false.), f3: (Variable 2 f3 Local () () Default (Integer 4 []) BindC Public Required .false.), f4: (Variable 2 f4 Local () () Default (Integer 4 []) BindC Public Required .false.), f5: (Variable 2 f5 Local () () Default (Integer 4 []) BindC Public Required .false.), f6: (Variable 2 f6 Local () () Default (Integer 4 []) BindC Public Required .false.), f7: (Variable 2 f7 Local () () Default (Integer 4 []) BindC Public Required .false.), f8: (Variable 2 f8 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (IntegerConstant 5 (Integer 4 [])) ()) (= (Var 2 f2) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) ()) (= (Var 2 f3) (IntegerBinOp (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) Mul (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant 16 (Integer 4 []))) ()) (= (Var 2 f4) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (IntegerConstant 2 (Integer 4 [])) (Integer 4 []) (IntegerConstant 6 (Integer 4 []))) (Integer 4 []) (IntegerConstant 11 (Integer 4 []))) ()) (= (Var 2 f5) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Sub (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 2 (Integer 4 []))) ()) (= (Var 2 f6) (IntegerBinOp (IntegerConstant 4 (Integer 4 [])) Pow (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 64 (Integer 4 []))) ()) (= (Var 2 f7) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) ()) (= (Var 2 f8) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) ())] (Var 2 f8) BindC Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/pass_global_stmts-expr4-eea496b.json b/tests/reference/pass_global_stmts-expr4-eea496b.json index 318df37af0..7c8bc18613 100644 --- a/tests/reference/pass_global_stmts-expr4-eea496b.json +++ b/tests/reference/pass_global_stmts-expr4-eea496b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr4-eea496b.stdout", - "stdout_hash": "bfe43294aef617ea8c74bd092702e8dc53c29075f030a56cab8af52f", + "stdout_hash": "b4c6b9f9f22ef5cd715be4db0f60a7674a827a09920553c62d42dcdb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-expr4-eea496b.stdout b/tests/reference/pass_global_stmts-expr4-eea496b.stdout index de82e398ab..4aa8548d94 100644 --- a/tests/reference/pass_global_stmts-expr4-eea496b.stdout +++ b/tests/reference/pass_global_stmts-expr4-eea496b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Real 4 []) BindC Public Required .false.), f2: (Variable 2 f2 Local () () Default (Real 4 []) BindC Public Required .false.), f3: (Variable 2 f3 Local () () Default (Real 4 []) BindC Public Required .false.), f4: (Variable 2 f4 Local () () Default (Real 4 []) BindC Public Required .false.), f5: (Variable 2 f5 Local () () Default (Real 4 []) BindC Public Required .false.), f6: (Variable 2 f6 ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (RealConstant 5.000000 (Real 4 [])) ()) (= (Var 2 f2) (RealBinOp (RealConstant 5.000000 (Real 4 [])) Add (RealConstant 3.000000 (Real 4 [])) (Real 4 []) (RealConstant 8.000000 (Real 4 []))) ()) (= (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 []))) ()) (= (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 []))) ()) (= (Var 2 f5) (RealBinOp (RealConstant 5.000000 (Real 4 [])) Sub (RealConstant 3.000000 (Real 4 [])) (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (Var 2 f6) (RealBinOp (RealConstant 4.000000 (Real 4 [])) Pow (RealConstant 3.000000 (Real 4 [])) (Real 4 []) (RealConstant 64.000000 (Real 4 []))) ())] (Var 2 f6) BindC Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Real 4 []) BindC Public Required .false.), f2: (Variable 2 f2 Local () () Default (Real 4 []) BindC Public Required .false.), f3: (Variable 2 f3 Local () () Default (Real 4 []) BindC Public Required .false.), f4: (Variable 2 f4 Local () () Default (Real 4 []) BindC Public Required .false.), f5: (Variable 2 f5 Local () () Default (Real 4 []) BindC Public Required .false.), f6: (Variable 2 f6 ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (RealConstant 5.000000 (Real 4 [])) ()) (= (Var 2 f2) (RealBinOp (RealConstant 5.000000 (Real 4 [])) Add (RealConstant 3.000000 (Real 4 [])) (Real 4 []) (RealConstant 8.000000 (Real 4 []))) ()) (= (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 []))) ()) (= (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 []))) ()) (= (Var 2 f5) (RealBinOp (RealConstant 5.000000 (Real 4 [])) Sub (RealConstant 3.000000 (Real 4 [])) (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (Var 2 f6) (RealBinOp (RealConstant 4.000000 (Real 4 [])) Pow (RealConstant 3.000000 (Real 4 [])) (Real 4 []) (RealConstant 64.000000 (Real 4 []))) ())] (Var 2 f6) BindC Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/pass_global_stmts-expr6-a926072.json b/tests/reference/pass_global_stmts-expr6-a926072.json index f2d19b8230..287fa2d939 100644 --- a/tests/reference/pass_global_stmts-expr6-a926072.json +++ b/tests/reference/pass_global_stmts-expr6-a926072.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-expr6-a926072.stdout", - "stdout_hash": "c760701891bb6d3d67893564f6e7ebbe42eac376e93455852d860eb5", + "stdout_hash": "87865dbac6e55020d27c96d27af2333ebdc4187fd8de92b86c8746ea", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-expr6-a926072.stdout b/tests/reference/pass_global_stmts-expr6-a926072.stdout index 7a42b56d4b..d713cdf88f 100644 --- a/tests/reference/pass_global_stmts-expr6-a926072.stdout +++ b/tests/reference/pass_global_stmts-expr6-a926072.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Integer 4 []) BindC Public Required .false.), f2: (Variable 2 f2 ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) ()) (= (Var 2 f2) (RealConstant 5.300000 (Real 4 [])) ())] (Var 2 f2) BindC Public Implementation () .false. .false. .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Integer 4 []) BindC Public Required .false.), f2: (Variable 2 f2 ReturnVar () () Default (Real 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (IntegerBinOp (IntegerConstant 5 (Integer 4 [])) Add (IntegerConstant 3 (Integer 4 [])) (Integer 4 []) (IntegerConstant 8 (Integer 4 []))) ()) (= (Var 2 f2) (RealConstant 5.300000 (Real 4 [])) ())] (Var 2 f2) BindC Public Implementation () .false. .false. .false. .false.)}) []) diff --git a/tests/reference/pass_global_stmts-global_scope2-64078e2.json b/tests/reference/pass_global_stmts-global_scope2-64078e2.json index ac811d7c9f..4c5271728a 100644 --- a/tests/reference/pass_global_stmts-global_scope2-64078e2.json +++ b/tests/reference/pass_global_stmts-global_scope2-64078e2.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope2-64078e2.stdout", - "stdout_hash": "4b43dee9d1400c3ed327f5e8ff7d4c937f857ba3b4641ae56dc103c7", + "stdout_hash": "c40f723d1e899df8bae9c6d7069343d270efcc160cd093a892735739", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-global_scope2-64078e2.stdout b/tests/reference/pass_global_stmts-global_scope2-64078e2.stdout index c09d32c0e3..00294d4d0a 100644 --- a/tests/reference/pass_global_stmts-global_scope2-64078e2.stdout +++ b/tests/reference/pass_global_stmts-global_scope2-64078e2.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) diff --git a/tests/reference/pass_global_stmts-global_scope3-a36d20b.json b/tests/reference/pass_global_stmts-global_scope3-a36d20b.json index 61c4a4b96f..edd9b8de12 100644 --- a/tests/reference/pass_global_stmts-global_scope3-a36d20b.json +++ b/tests/reference/pass_global_stmts-global_scope3-a36d20b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope3-a36d20b.stdout", - "stdout_hash": "4403cf73fb6bc3652d288e6877114dbd219a904db7cf8119dc9cf3a7", + "stdout_hash": "cca6473007e08e446a853dace9f54baebb0d74219cfb31aa4e500ba2", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-global_scope3-a36d20b.stdout b/tests/reference/pass_global_stmts-global_scope3-a36d20b.stdout index 622e324df0..5be8e60626 100644 --- a/tests/reference/pass_global_stmts-global_scope3-a36d20b.stdout +++ b/tests/reference/pass_global_stmts-global_scope3-a36d20b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) diff --git a/tests/reference/pass_global_stmts-global_scope4-2d4061d.json b/tests/reference/pass_global_stmts-global_scope4-2d4061d.json index 3ddd76b47e..6ddde8b89b 100644 --- a/tests/reference/pass_global_stmts-global_scope4-2d4061d.json +++ b/tests/reference/pass_global_stmts-global_scope4-2d4061d.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope4-2d4061d.stdout", - "stdout_hash": "a66633c2d8c82e83595d304abc25a220887e21c8d7470937b0b396bb", + "stdout_hash": "a0252d23bffdefb3586609623fe1eb10af6d25169bcbb59dc00a64a8", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-global_scope4-2d4061d.stdout b/tests/reference/pass_global_stmts-global_scope4-2d4061d.stdout index 0d80758444..8917a085f1 100644 --- a/tests/reference/pass_global_stmts-global_scope4-2d4061d.stdout +++ b/tests/reference/pass_global_stmts-global_scope4-2d4061d.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 2 f1) (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 1 x) (Integer 4 []) ()) ())] (Var 2 f1) BindC Public Implementation () .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 2 f1) (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 1 x) (Integer 4 []) ()) ())] (Var 2 f1) BindC Public Implementation () .false. .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) diff --git a/tests/reference/pass_global_stmts-global_scope5-fb3716b.json b/tests/reference/pass_global_stmts-global_scope5-fb3716b.json index ca645bb2ee..d6c2a9d228 100644 --- a/tests/reference/pass_global_stmts-global_scope5-fb3716b.json +++ b/tests/reference/pass_global_stmts-global_scope5-fb3716b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope5-fb3716b.stdout", - "stdout_hash": "bf304a5316fd547fca8f597911520229ac2d4d68d2900b43bda4d965", + "stdout_hash": "c83d71b78b479d43e4776f4b3a04fb4da4840d506e661ba9de08e1fb", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-global_scope5-fb3716b.stdout b/tests/reference/pass_global_stmts-global_scope5-fb3716b.stdout index d017cac907..09c68f7440 100644 --- a/tests/reference/pass_global_stmts-global_scope5-fb3716b.stdout +++ b/tests/reference/pass_global_stmts-global_scope5-fb3716b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Integer 4 []) BindC Public Required .false.), f2: (Variable 2 f2 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 1 x) (Integer 4 []) ()) ()) (= (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 2 f2) (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 1 x) (Integer 4 []) ()) ())] (Var 2 f2) BindC Public Implementation () .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Integer 4 []) BindC Public Required .false.), f2: (Variable 2 f2 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 1 x) (Integer 4 []) ()) ()) (= (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ()) (= (Var 2 f2) (IntegerBinOp (IntegerConstant 3 (Integer 4 [])) Mul (Var 1 x) (Integer 4 []) ()) ())] (Var 2 f2) BindC Public Implementation () .false. .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) diff --git a/tests/reference/pass_global_stmts-global_scope6-278bd63.json b/tests/reference/pass_global_stmts-global_scope6-278bd63.json index 2278221350..4dc8956a7a 100644 --- a/tests/reference/pass_global_stmts-global_scope6-278bd63.json +++ b/tests/reference/pass_global_stmts-global_scope6-278bd63.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope6-278bd63.stdout", - "stdout_hash": "993c9459919623861b481eab2f0c61ed4e66fa69a2b8bab5e41458df", + "stdout_hash": "76bf7aefa209ab7af42ba4f5d951ce412e02f53242177e0acb3d562a", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-global_scope6-278bd63.stdout b/tests/reference/pass_global_stmts-global_scope6-278bd63.stdout index 667bea133a..2945af4174 100644 --- a/tests/reference/pass_global_stmts-global_scope6-278bd63.stdout +++ b/tests/reference/pass_global_stmts-global_scope6-278bd63.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 1 x) (Integer 4 []) ()) ()) (= (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 1 x) (Integer 4 []) ()) ()) (= (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) diff --git a/tests/reference/pass_global_stmts-global_scope7-d6ec187.json b/tests/reference/pass_global_stmts-global_scope7-d6ec187.json index 0ea6e2a416..bcba967743 100644 --- a/tests/reference/pass_global_stmts-global_scope7-d6ec187.json +++ b/tests/reference/pass_global_stmts-global_scope7-d6ec187.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope7-d6ec187.stdout", - "stdout_hash": "f973743d2e010b06b38862693b774df4391b024689a1b8f13e277354", + "stdout_hash": "8cbfd9763d291c8811c34882e9f1b33f57a87eac871b6268d23f1bbd", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-global_scope7-d6ec187.stdout b/tests/reference/pass_global_stmts-global_scope7-d6ec187.stdout index d5f2488111..89c6fdf82e 100644 --- a/tests/reference/pass_global_stmts-global_scope7-d6ec187.stdout +++ b/tests/reference/pass_global_stmts-global_scope7-d6ec187.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 1 x) (Integer 4 []) ()) ()) (= (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 1 x Local (IntegerConstant 6 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 Local () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 2 f1) (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 1 x) (Integer 4 []) ()) ()) (= (Var 1 x) (IntegerBinOp (Var 1 x) Add (IntegerConstant 1 (Integer 4 [])) (Integer 4 []) ()) ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 1 x Local (IntegerConstant 6 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) []) diff --git a/tests/reference/pass_global_stmts-global_scope8-95c3673.json b/tests/reference/pass_global_stmts-global_scope8-95c3673.json index 24921dc55c..37c8547a21 100644 --- a/tests/reference/pass_global_stmts-global_scope8-95c3673.json +++ b/tests/reference/pass_global_stmts-global_scope8-95c3673.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope8-95c3673.stdout", - "stdout_hash": "37bc3e7e9c0b62d47d58b530891c0630064ce21f2607274de3f696d6", + "stdout_hash": "b6b82f5fb37eef4184b834ec2b2bd0d3213c1bcc3416d11dac5caf89", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-global_scope8-95c3673.stdout b/tests/reference/pass_global_stmts-global_scope8-95c3673.stdout index 74372e7456..fbf05edab3 100644 --- a/tests/reference/pass_global_stmts-global_scope8-95c3673.stdout +++ b/tests/reference/pass_global_stmts-global_scope8-95c3673.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 2 f1) (Var 1 x) ())] (Var 2 f1) BindC Public Implementation () .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 ReturnVar () () Default (Integer 4 []) BindC Public Required .false.)}) f [] [] [(= (Var 1 x) (IntegerConstant 6 (Integer 4 [])) ()) (= (Var 2 f1) (Var 1 x) ())] (Var 2 f1) BindC Public Implementation () .false. .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 4 []) Source Public Required .false.)}) []) diff --git a/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.json b/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.json index cfeb6a81d5..6bd22f440b 100644 --- a/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.json +++ b/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_global_stmts-global_scope9-4cbbc3e.stdout", - "stdout_hash": "05dcd04d0e4d13e30f148e4c35e7286055e74e3befe783be7658ad58", + "stdout_hash": "92857fa31b737318eed496b3986c43d2fdf959324434d630a0e0ceb0", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.stdout b/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.stdout index 0dd9927993..59c7483cb6 100644 --- a/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.stdout +++ b/tests/reference/pass_global_stmts-global_scope9-4cbbc3e.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) f [] [] [(= (Var 1 x) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 6 (Integer 8 []))) ()) (= (Var 2 f1) (Var 1 x) ())] (Var 2 f1) BindC Public Implementation () .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 8 []) Source Public Required .false.)}) []) +(TranslationUnit (SymbolTable 1 {f: (Function (SymbolTable 2 {f1: (Variable 2 f1 ReturnVar () () Default (Integer 8 []) BindC Public Required .false.)}) f [] [] [(= (Var 1 x) (Cast (IntegerConstant 6 (Integer 4 [])) IntegerToInteger (Integer 8 []) (IntegerConstant 6 (Integer 8 []))) ()) (= (Var 2 f1) (Var 1 x) ())] (Var 2 f1) BindC Public Implementation () .false. .false. .false. .false.), x: (Variable 1 x Local () () Default (Integer 8 []) Source Public Required .false.)}) []) diff --git a/tests/reference/pass_inline_function_calls-functions_05-73805d1.json b/tests/reference/pass_inline_function_calls-functions_05-73805d1.json index aa1c7d4893..b4540ab004 100644 --- a/tests/reference/pass_inline_function_calls-functions_05-73805d1.json +++ b/tests/reference/pass_inline_function_calls-functions_05-73805d1.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_05-73805d1.stdout", - "stdout_hash": "b34a1746c92f00eaca90046fd1ac7ce56374858512f8bb2b3b60e192", + "stdout_hash": "39c275943f508494da2b0c71a374d3307d34689729a87e483ce6aa03", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_inline_function_calls-functions_05-73805d1.stdout b/tests/reference/pass_inline_function_calls-functions_05-73805d1.stdout index 61a448fea3..0307500050 100644 --- a/tests/reference/pass_inline_function_calls-functions_05-73805d1.stdout +++ b/tests/reference/pass_inline_function_calls-functions_05-73805d1.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {functions_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 []) Source Public Required .false.), a_f: (Variable 2 a_f Local () () Default (Integer 4 []) Source Public Required .false.), a_f_real: (Variable 2 a_f_real Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), b_f: (Variable 2 b_f Local () () Default (Integer 4 []) Source Public Required .false.), b_f_real: (Variable 2 b_f_real Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) f [(Var 3 a)] [] [(= (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4 []) ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false.), f_real: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), r_signr32: (Variable 4 r_signr32 Local () () Default (Real 4 []) Source Public Required .false.), x_signr32: (Variable 4 x_signr32 Local () () Default (Real 4 []) Source Public Required .false.), y_signr32: (Variable 4 y_signr32 Local () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 4 a)] [] [(= (Var 4 x_signr32) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 4 y_signr32) (Var 4 a) ()) (= (Var 4 r_signr32) (Var 4 x_signr32) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 4 x_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 4 y_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 4 x_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 4 y_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 4 r_signr32) (Var 4 x_signr32) ())] [(= (Var 4 r_signr32) (RealUnaryMinus (Var 4 x_signr32) (Real 4 []) ()) ())]) (= (Var 4 b) (RealBinOp (Var 4 a) Add (Var 4 r_signr32) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false.), p: (Variable 2 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 2 q Local () () Default (Real 4 []) Source Public Required .false.), r_signr32: (Variable 2 r_signr32 Local () () Default (Real 4 []) Source Public Required .false.), r_signr32_f_real: (Variable 2 r_signr32_f_real Local () () Default (Real 4 []) Source Public Required .false.), signr32: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y In () () Default (Real 4 []) Source Public Required .false.)}) signr32 [(Var 5 x) (Var 5 y)] [] [(= (Var 5 r) (Var 5 x) ()) (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 []) ()) [(= (Var 5 r) (Var 5 x) ())] [(= (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4 []) ()) ())])] (Var 5 r) Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local (IntegerConstant 5 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), x_f: (Variable 2 x_f Local () () Default (Integer 4 []) Source Public Required .false.), x_signr32: (Variable 2 x_signr32 Local () () Default (Real 4 []) Source Public Required .false.), x_signr32_f_real: (Variable 2 x_signr32_f_real Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 []) Source Public Required .false.), y_signr32: (Variable 2 y_signr32 Local () () Default (Real 4 []) Source Public Required .false.), y_signr32_f_real: (Variable 2 y_signr32_f_real Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 2 a_f) (Var 2 x) ()) (= (Var 2 x_f) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b_f) (IntegerBinOp (Var 2 a_f) Add (Var 2 x_f) (Integer 4 []) ()) ()) (= (Var 2 y) (Var 2 b_f) ()) (Print () [(Var 2 y)] () ()) (= (Var 2 a_f_real) (Var 2 p) ()) (= (Var 2 x_signr32_f_real) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 2 y_signr32_f_real) (Var 2 a_f_real) ()) (= (Var 2 r_signr32_f_real) (Var 2 x_signr32_f_real) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 2 x_signr32_f_real) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32_f_real) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 2 x_signr32_f_real) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32_f_real) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 2 r_signr32_f_real) (Var 2 x_signr32_f_real) ())] [(= (Var 2 r_signr32_f_real) (RealUnaryMinus (Var 2 x_signr32_f_real) (Real 4 []) ()) ())]) (= (Var 2 b_f_real) (RealBinOp (Var 2 a_f_real) Add (Var 2 r_signr32_f_real) (Real 4 []) ()) ()) (= (Var 2 q) (Var 2 b_f_real) ()) (Print () [(Var 2 q)] () ()) (= (Var 2 a) (RealConstant 20.000000 (Real 4 [])) ()) (= (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4 [])) (Real 4 []) (RealConstant -30.000000 (Real 4 []))) ()) (= (Var 2 x_signr32) (Var 2 a) ()) (= (Var 2 y_signr32) (Var 2 b) ()) (= (Var 2 r_signr32) (Var 2 x_signr32) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 2 x_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 2 x_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 2 r_signr32) (Var 2 x_signr32) ())] [(= (Var 2 r_signr32) (RealUnaryMinus (Var 2 x_signr32) (Real 4 []) ()) ())]) (= (Var 2 c) (Var 2 r_signr32) ()) (Print () [(Var 2 c)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {functions_01: (Program (SymbolTable 2 {a: (Variable 2 a Local () () Default (Real 4 []) Source Public Required .false.), a_f: (Variable 2 a_f Local () () Default (Integer 4 []) Source Public Required .false.), a_f_real: (Variable 2 a_f_real Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 2 b Local () () Default (Real 4 []) Source Public Required .false.), b_f: (Variable 2 b_f Local () () Default (Integer 4 []) Source Public Required .false.), b_f_real: (Variable 2 b_f_real Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 2 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 3 {a: (Variable 3 a In () () Default (Integer 4 []) Source Public Required .false.), b: (Variable 3 b ReturnVar () () Default (Integer 4 []) Source Public Required .false.), x: (Variable 3 x Local (IntegerConstant 2 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.)}) f [(Var 3 a)] [] [(= (Var 3 b) (IntegerBinOp (Var 3 a) Add (Var 3 x) (Integer 4 []) ()) ())] (Var 3 b) Source Public Implementation () .false. .false. .false. .false.), f_real: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), r_signr32: (Variable 4 r_signr32 Local () () Default (Real 4 []) Source Public Required .false.), x_signr32: (Variable 4 x_signr32 Local () () Default (Real 4 []) Source Public Required .false.), y_signr32: (Variable 4 y_signr32 Local () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 4 a)] [] [(= (Var 4 x_signr32) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 4 y_signr32) (Var 4 a) ()) (= (Var 4 r_signr32) (Var 4 x_signr32) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 4 x_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 4 y_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 4 x_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 4 y_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 4 r_signr32) (Var 4 x_signr32) ())] [(= (Var 4 r_signr32) (RealUnaryMinus (Var 4 x_signr32) (Real 4 []) ()) ())]) (= (Var 4 b) (RealBinOp (Var 4 a) Add (Var 4 r_signr32) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false. .false.), p: (Variable 2 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 2 q Local () () Default (Real 4 []) Source Public Required .false.), r_signr32: (Variable 2 r_signr32 Local () () Default (Real 4 []) Source Public Required .false.), r_signr32_f_real: (Variable 2 r_signr32_f_real Local () () Default (Real 4 []) Source Public Required .false.), signr32: (Function (SymbolTable 5 {r: (Variable 5 r ReturnVar () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y In () () Default (Real 4 []) Source Public Required .false.)}) signr32 [(Var 5 x) (Var 5 y)] [] [(= (Var 5 r) (Var 5 x) ()) (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 []) ()) [(= (Var 5 r) (Var 5 x) ())] [(= (Var 5 r) (RealUnaryMinus (Var 5 x) (Real 4 []) ()) ())])] (Var 5 r) Source Public Implementation () .false. .false. .false. .false.), x: (Variable 2 x Local (IntegerConstant 5 (Integer 4 [])) () Save (Integer 4 []) Source Public Required .false.), x_f: (Variable 2 x_f Local () () Default (Integer 4 []) Source Public Required .false.), x_signr32: (Variable 2 x_signr32 Local () () Default (Real 4 []) Source Public Required .false.), x_signr32_f_real: (Variable 2 x_signr32_f_real Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 2 y Local () () Default (Integer 4 []) Source Public Required .false.), y_signr32: (Variable 2 y_signr32 Local () () Default (Real 4 []) Source Public Required .false.), y_signr32_f_real: (Variable 2 y_signr32_f_real Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 2 a_f) (Var 2 x) ()) (= (Var 2 x_f) (IntegerConstant 2 (Integer 4 [])) ()) (= (Var 2 b_f) (IntegerBinOp (Var 2 a_f) Add (Var 2 x_f) (Integer 4 []) ()) ()) (= (Var 2 y) (Var 2 b_f) ()) (Print () [(Var 2 y)] () ()) (= (Var 2 a_f_real) (Var 2 p) ()) (= (Var 2 x_signr32_f_real) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 2 y_signr32_f_real) (Var 2 a_f_real) ()) (= (Var 2 r_signr32_f_real) (Var 2 x_signr32_f_real) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 2 x_signr32_f_real) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32_f_real) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 2 x_signr32_f_real) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32_f_real) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 2 r_signr32_f_real) (Var 2 x_signr32_f_real) ())] [(= (Var 2 r_signr32_f_real) (RealUnaryMinus (Var 2 x_signr32_f_real) (Real 4 []) ()) ())]) (= (Var 2 b_f_real) (RealBinOp (Var 2 a_f_real) Add (Var 2 r_signr32_f_real) (Real 4 []) ()) ()) (= (Var 2 q) (Var 2 b_f_real) ()) (Print () [(Var 2 q)] () ()) (= (Var 2 a) (RealConstant 20.000000 (Real 4 [])) ()) (= (Var 2 b) (RealUnaryMinus (RealConstant 30.000000 (Real 4 [])) (Real 4 []) (RealConstant -30.000000 (Real 4 []))) ()) (= (Var 2 x_signr32) (Var 2 a) ()) (= (Var 2 y_signr32) (Var 2 b) ()) (= (Var 2 r_signr32) (Var 2 x_signr32) ()) (If (LogicalBinOp (LogicalBinOp (RealCompare (Var 2 x_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32) GtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) Or (LogicalBinOp (RealCompare (Var 2 x_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) And (RealCompare (Var 2 y_signr32) LtE (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) (Logical 4 []) ()) (Logical 4 []) ()) [(= (Var 2 r_signr32) (Var 2 x_signr32) ())] [(= (Var 2 r_signr32) (RealUnaryMinus (Var 2 x_signr32) (Real 4 []) ()) ())]) (= (Var 2 c) (Var 2 r_signr32) ()) (Print () [(Var 2 c)] () ())])}) []) diff --git a/tests/reference/pass_inline_function_calls-functions_07-cc20830.json b/tests/reference/pass_inline_function_calls-functions_07-cc20830.json index 744e1009e8..1fec167f87 100644 --- a/tests/reference/pass_inline_function_calls-functions_07-cc20830.json +++ b/tests/reference/pass_inline_function_calls-functions_07-cc20830.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_07-cc20830.stdout", - "stdout_hash": "d33bcb9ab5720092c1719919c99d2a4c947b003ff82e056b6d1bd8c9", + "stdout_hash": "dc332ab825280707270ba7511f95ede226c4e9363d0d3cf75f296d72", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_inline_function_calls-functions_07-cc20830.stdout b/tests/reference/pass_inline_function_calls-functions_07-cc20830.stdout index 45bbc930e5..b7af4971d7 100644 --- a/tests/reference/pass_inline_function_calls-functions_07-cc20830.stdout +++ b/tests/reference/pass_inline_function_calls-functions_07-cc20830.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {f_a: (Function (SymbolTable 3 {u: (Variable 3 u In () () Default (Real 4 []) Source Public Required .false.), v: (Variable 3 v ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_a [(Var 3 u)] [] [(= (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 3 v) Source Public Implementation () .false. .false. .false.)}) a [] .false. .false.), b: (Module (SymbolTable 4 {f_a: (ExternalSymbol 4 f_a 2 f_a a [] f_a Public), f_b: (Function (SymbolTable 5 {u_f_a: (Variable 5 u_f_a Local () () Default (Real 4 []) Source Public Required .false.), v_f_a: (Variable 5 v_f_a Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_b [(Var 5 x)] [] [(= (Var 5 u_f_a) (Var 5 x) ()) (= (Var 5 v_f_a) (RealBinOp (Var 5 u_f_a) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 5 y) (RealBinOp (Var 5 v_f_a) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 5 y) Source Public Implementation () .false. .false. .false.)}) b [a] .false. .false.), c: (Module (SymbolTable 6 {f_a: (ExternalSymbol 6 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 6 f_b 4 f_b b [] f_b Public), f_c: (Function (SymbolTable 7 {u_f_a_f_b: (Variable 7 u_f_a_f_b Local () () Default (Real 4 []) Source Public Required .false.), v_f_a_f_b: (Variable 7 v_f_a_f_b Local () () Default (Real 4 []) Source Public Required .false.), w: (Variable 7 w In () () Default (Real 4 []) Source Public Required .false.), x_f_b: (Variable 7 x_f_b Local () () Default (Real 4 []) Source Public Required .false.), y_f_b: (Variable 7 y_f_b Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 7 z ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_c [(Var 7 w)] [] [(= (Var 7 x_f_b) (Var 7 w) ()) (= (Var 7 u_f_a_f_b) (Var 7 x_f_b) ()) (= (Var 7 v_f_a_f_b) (RealBinOp (Var 7 u_f_a_f_b) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 7 y_f_b) (RealBinOp (Var 7 v_f_a_f_b) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 7 z) (RealBinOp (Var 7 y_f_b) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 7 z) Source Public Implementation () .false. .false. .false.)}) c [b] .false. .false.), functions_07: (Program (SymbolTable 8 {f_a: (ExternalSymbol 8 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 8 f_b 4 f_b b [] f_b Public), f_c: (ExternalSymbol 8 f_c 6 f_c c [] f_c Public), p: (Variable 8 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 8 q Local () () Default (Real 4 []) Source Public Required .false.), u_f_a_f_b_f_c: (Variable 8 u_f_a_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), v_f_a_f_b_f_c: (Variable 8 v_f_a_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), w_f_c: (Variable 8 w_f_c Local () () Default (Real 4 []) Source Public Required .false.), x_f_b_f_c: (Variable 8 x_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), y_f_b_f_c: (Variable 8 y_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), z_f_c: (Variable 8 z_f_c Local () () Default (Real 4 []) Source Public Required .false.)}) functions_07 [c] [(= (Var 8 w_f_c) (Var 8 p) ()) (= (Var 8 x_f_b_f_c) (Var 8 w_f_c) ()) (= (Var 8 u_f_a_f_b_f_c) (Var 8 x_f_b_f_c) ()) (= (Var 8 v_f_a_f_b_f_c) (RealBinOp (Var 8 u_f_a_f_b_f_c) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 8 y_f_b_f_c) (RealBinOp (Var 8 v_f_a_f_b_f_c) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 8 z_f_c) (RealBinOp (Var 8 y_f_b_f_c) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 8 q) (Var 8 z_f_c) ()) (Print () [(Var 8 q)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {f_a: (Function (SymbolTable 3 {u: (Variable 3 u In () () Default (Real 4 []) Source Public Required .false.), v: (Variable 3 v ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_a [(Var 3 u)] [] [(= (Var 3 v) (RealBinOp (Var 3 u) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 3 v) Source Public Implementation () .false. .false. .false. .false.)}) a [] .false. .false.), b: (Module (SymbolTable 4 {f_a: (ExternalSymbol 4 f_a 2 f_a a [] f_a Public), f_b: (Function (SymbolTable 5 {u_f_a: (Variable 5 u_f_a Local () () Default (Real 4 []) Source Public Required .false.), v_f_a: (Variable 5 v_f_a Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 5 x In () () Default (Real 4 []) Source Public Required .false.), y: (Variable 5 y ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_b [(Var 5 x)] [] [(= (Var 5 u_f_a) (Var 5 x) ()) (= (Var 5 v_f_a) (RealBinOp (Var 5 u_f_a) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 5 y) (RealBinOp (Var 5 v_f_a) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 5 y) Source Public Implementation () .false. .false. .false. .false.)}) b [a] .false. .false.), c: (Module (SymbolTable 6 {f_a: (ExternalSymbol 6 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 6 f_b 4 f_b b [] f_b Public), f_c: (Function (SymbolTable 7 {u_f_a_f_b: (Variable 7 u_f_a_f_b Local () () Default (Real 4 []) Source Public Required .false.), v_f_a_f_b: (Variable 7 v_f_a_f_b Local () () Default (Real 4 []) Source Public Required .false.), w: (Variable 7 w In () () Default (Real 4 []) Source Public Required .false.), x_f_b: (Variable 7 x_f_b Local () () Default (Real 4 []) Source Public Required .false.), y_f_b: (Variable 7 y_f_b Local () () Default (Real 4 []) Source Public Required .false.), z: (Variable 7 z ReturnVar () () Default (Real 4 []) Source Public Required .false.)}) f_c [(Var 7 w)] [] [(= (Var 7 x_f_b) (Var 7 w) ()) (= (Var 7 u_f_a_f_b) (Var 7 x_f_b) ()) (= (Var 7 v_f_a_f_b) (RealBinOp (Var 7 u_f_a_f_b) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 7 y_f_b) (RealBinOp (Var 7 v_f_a_f_b) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 7 z) (RealBinOp (Var 7 y_f_b) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ())] (Var 7 z) Source Public Implementation () .false. .false. .false. .false.)}) c [b] .false. .false.), functions_07: (Program (SymbolTable 8 {f_a: (ExternalSymbol 8 f_a 2 f_a a [] f_a Public), f_b: (ExternalSymbol 8 f_b 4 f_b b [] f_b Public), f_c: (ExternalSymbol 8 f_c 6 f_c c [] f_c Public), p: (Variable 8 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 8 q Local () () Default (Real 4 []) Source Public Required .false.), u_f_a_f_b_f_c: (Variable 8 u_f_a_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), v_f_a_f_b_f_c: (Variable 8 v_f_a_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), w_f_c: (Variable 8 w_f_c Local () () Default (Real 4 []) Source Public Required .false.), x_f_b_f_c: (Variable 8 x_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), y_f_b_f_c: (Variable 8 y_f_b_f_c Local () () Default (Real 4 []) Source Public Required .false.), z_f_c: (Variable 8 z_f_c Local () () Default (Real 4 []) Source Public Required .false.)}) functions_07 [c] [(= (Var 8 w_f_c) (Var 8 p) ()) (= (Var 8 x_f_b_f_c) (Var 8 w_f_c) ()) (= (Var 8 u_f_a_f_b_f_c) (Var 8 x_f_b_f_c) ()) (= (Var 8 v_f_a_f_b_f_c) (RealBinOp (Var 8 u_f_a_f_b_f_c) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 8 y_f_b_f_c) (RealBinOp (Var 8 v_f_a_f_b_f_c) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 8 z_f_c) (RealBinOp (Var 8 y_f_b_f_c) Add (RealConstant 1.000000 (Real 4 [])) (Real 4 []) ()) ()) (= (Var 8 q) (Var 8 z_f_c) ()) (Print () [(Var 8 q)] () ())])}) []) diff --git a/tests/reference/pass_inline_function_calls-functions_08-515120b.json b/tests/reference/pass_inline_function_calls-functions_08-515120b.json index 08c620a7df..5a7bba4af3 100644 --- a/tests/reference/pass_inline_function_calls-functions_08-515120b.json +++ b/tests/reference/pass_inline_function_calls-functions_08-515120b.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_inline_function_calls-functions_08-515120b.stdout", - "stdout_hash": "a959b41d2e164cbfd346059f1d68ae37f4d59284a051a642cfb030d1", + "stdout_hash": "548c379d4402cd3ca88c4eec5639a88b966b78e02f2864451704d787", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_inline_function_calls-functions_08-515120b.stdout b/tests/reference/pass_inline_function_calls-functions_08-515120b.stdout index 7a63e2c4a4..3d6670c44b 100644 --- a/tests/reference/pass_inline_function_calls-functions_08-515120b.stdout +++ b/tests/reference/pass_inline_function_calls-functions_08-515120b.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {}) a [] .false. .false.), functions_01: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 []) Source Public Required .false.), a_f: (Variable 3 a_f Local () () Default (Real 4 []) Source Public Required .false.), a_f_real: (Variable 3 a_f_real Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 []) Source Public Required .false.), b_f: (Variable 3 b_f Local () () Default (Real 4 []) Source Public Required .false.), b_f_real: (Variable 3 b_f_real Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), a_f_real: (Variable 4 a_f_real Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), b_f_real: (Variable 4 b_f_real Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x Local (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) f [(Var 4 a)] [] [(= (Var 4 a_f_real) (RealConstant 0.000000 (Real 4 [])) ()) (If (RealCompare (Var 4 a_f_real) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 4 b_f_real) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 4 b_f_real) (RealBinOp (Var 4 a_f_real) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())]) (= (Var 4 b) (RealBinOp (Var 4 a) Add (Var 4 b_f_real) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false.), f_real: (Function (SymbolTable 5 {a: (Variable 5 a In () () Default (Real 4 []) Source Public Required .false.), a_f: (Variable 5 a_f Local () () Default (Real 4 []) Source Public Required .false.), a_f_real_f: (Variable 5 a_f_real_f Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 5 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), b_f: (Variable 5 b_f Local () () Default (Real 4 []) Source Public Required .false.), b_f_real_f: (Variable 5 b_f_real_f Local () () Default (Real 4 []) Source Public Required .false.), x_f: (Variable 5 x_f Local () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 5 a)] [] [(= (Var 5 a_f) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 5 x_f) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (Var 5 a_f_real_f) (RealConstant 0.000000 (Real 4 [])) ()) (If (RealCompare (Var 5 a_f_real_f) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b_f_real_f) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b_f_real_f) (RealBinOp (Var 5 a_f_real_f) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())]) (= (Var 5 b_f) (RealBinOp (Var 5 a_f) Add (Var 5 b_f_real_f) (Real 4 []) ()) ()) (If (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b) (RealBinOp (Var 5 a) Add (Var 5 b_f) (Real 4 []) ()) ())])] (Var 5 b) Source Public Implementation () .false. .false. .false.), p: (Variable 3 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 3 q Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 3 x Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), x_f: (Variable 3 x_f Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 3 a_f) (Var 3 x) ()) (= (Var 3 x_f) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (Var 3 b_f) (RealBinOp (Var 3 a_f) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ()) (= (Var 3 y) (Var 3 b_f) ()) (Print () [(Var 3 y)] () ()) (= (Var 3 a_f_real) (Var 3 p) ()) (If (RealCompare (Var 3 a_f_real) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 3 b_f_real) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 3 b_f_real) (RealBinOp (Var 3 a_f_real) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())]) (= (Var 3 q) (Var 3 b_f_real) ()) (Print () [(Var 3 q)] () ())])}) []) +(TranslationUnit (SymbolTable 1 {a: (Module (SymbolTable 2 {}) a [] .false. .false.), functions_01: (Program (SymbolTable 3 {a: (Variable 3 a Local () () Default (Real 4 []) Source Public Required .false.), a_f: (Variable 3 a_f Local () () Default (Real 4 []) Source Public Required .false.), a_f_real: (Variable 3 a_f_real Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 3 b Local () () Default (Real 4 []) Source Public Required .false.), b_f: (Variable 3 b_f Local () () Default (Real 4 []) Source Public Required .false.), b_f_real: (Variable 3 b_f_real Local () () Default (Real 4 []) Source Public Required .false.), c: (Variable 3 c Local () () Default (Real 4 []) Source Public Required .false.), f: (Function (SymbolTable 4 {a: (Variable 4 a In () () Default (Real 4 []) Source Public Required .false.), a_f_real: (Variable 4 a_f_real Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 4 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), b_f_real: (Variable 4 b_f_real Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 4 x Local (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.)}) f [(Var 4 a)] [] [(= (Var 4 a_f_real) (RealConstant 0.000000 (Real 4 [])) ()) (If (RealCompare (Var 4 a_f_real) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 4 b_f_real) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 4 b_f_real) (RealBinOp (Var 4 a_f_real) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())]) (= (Var 4 b) (RealBinOp (Var 4 a) Add (Var 4 b_f_real) (Real 4 []) ()) ())] (Var 4 b) Source Public Implementation () .false. .false. .false. .false.), f_real: (Function (SymbolTable 5 {a: (Variable 5 a In () () Default (Real 4 []) Source Public Required .false.), a_f: (Variable 5 a_f Local () () Default (Real 4 []) Source Public Required .false.), a_f_real_f: (Variable 5 a_f_real_f Local () () Default (Real 4 []) Source Public Required .false.), b: (Variable 5 b ReturnVar () () Default (Real 4 []) Source Public Required .false.), b_f: (Variable 5 b_f Local () () Default (Real 4 []) Source Public Required .false.), b_f_real_f: (Variable 5 b_f_real_f Local () () Default (Real 4 []) Source Public Required .false.), x_f: (Variable 5 x_f Local () () Default (Real 4 []) Source Public Required .false.)}) f_real [(Var 5 a)] [] [(= (Var 5 a_f) (RealConstant 1.000000 (Real 4 [])) ()) (= (Var 5 x_f) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (Var 5 a_f_real_f) (RealConstant 0.000000 (Real 4 [])) ()) (If (RealCompare (Var 5 a_f_real_f) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b_f_real_f) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b_f_real_f) (RealBinOp (Var 5 a_f_real_f) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())]) (= (Var 5 b_f) (RealBinOp (Var 5 a_f) Add (Var 5 b_f_real_f) (Real 4 []) ()) ()) (If (RealCompare (Var 5 a) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 5 b) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 5 b) (RealBinOp (Var 5 a) Add (Var 5 b_f) (Real 4 []) ()) ())])] (Var 5 b) Source Public Implementation () .false. .false. .false. .false.), p: (Variable 3 p Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), q: (Variable 3 q Local () () Default (Real 4 []) Source Public Required .false.), x: (Variable 3 x Local (Cast (IntegerConstant 5 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 5.000000 (Real 4 []))) () Save (Real 4 []) Source Public Required .false.), x_f: (Variable 3 x_f Local () () Default (Real 4 []) Source Public Required .false.), y: (Variable 3 y Local () () Default (Real 4 []) Source Public Required .false.)}) functions_01 [] [(= (Var 3 a_f) (Var 3 x) ()) (= (Var 3 x_f) (Cast (IntegerConstant 2 (Integer 4 [])) IntegerToReal (Real 4 []) (RealConstant 2.000000 (Real 4 []))) ()) (= (Var 3 b_f) (RealBinOp (Var 3 a_f) Add (FunctionCall 3 f_real () [((RealConstant 0.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ()) (= (Var 3 y) (Var 3 b_f) ()) (Print () [(Var 3 y)] () ()) (= (Var 3 a_f_real) (Var 3 p) ()) (If (RealCompare (Var 3 a_f_real) Eq (RealConstant 0.000000 (Real 4 [])) (Logical 4 []) ()) [(= (Var 3 b_f_real) (RealConstant 2.000000 (Real 4 [])) ())] [(= (Var 3 b_f_real) (RealBinOp (Var 3 a_f_real) Add (FunctionCall 3 f () [((RealConstant 1.000000 (Real 4 [])))] (Real 4 []) () ()) (Real 4 []) ()) ())]) (= (Var 3 q) (Var 3 b_f_real) ()) (Print () [(Var 3 q)] () ())])}) []) diff --git a/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.json b/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.json index cb2d9134d1..0288634f72 100644 --- a/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.json +++ b/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.json @@ -6,7 +6,7 @@ "outfile": null, "outfile_hash": null, "stdout": "pass_loop_unroll-loop_unroll_small-462d647.stdout", - "stdout_hash": "81a9a0d71108fda0829338b7b3308418cac81ad79f12a6e3b38bc8c1", + "stdout_hash": "4d8039cf564d13d2a3bd36327bf92d60262966ad430e0cc88ece8776", "stderr": null, "stderr_hash": null, "returncode": 0 diff --git a/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.stdout b/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.stdout index 33489d7920..fdb9a7f5be 100644 --- a/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.stdout +++ b/tests/reference/pass_loop_unroll-loop_unroll_small-462d647.stdout @@ -1 +1 @@ -(TranslationUnit (SymbolTable 1 {loop_unroll_small: (Program (SymbolTable 2 {array: (Variable 2 array Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), first: (Variable 2 first Local () () Default (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), last: (Variable 2 last Local () () Default (Integer 4 []) Source Public Required .false.), print_subrout: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) print_subrout [(Var 3 x)] [] [(Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.)}) loop_unroll_small [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 first) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 last) (IntegerConstant 4 (Integer 4 [])) ()) (DoLoop ((Var 2 i) (Var 2 first) (Var 2 last) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (IntegerBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) Add (Var 2 i) (Integer 4 []) ()) ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (SubroutineCall 2 print_subrout () [((Var 2 x))] ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (If (IntegerCompare (Var 2 x) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 i) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])}) []) +(TranslationUnit (SymbolTable 1 {loop_unroll_small: (Program (SymbolTable 2 {array: (Variable 2 array Local () () Default (Integer 4 [((IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])))]) Source Public Required .false.), first: (Variable 2 first Local () () Default (Integer 4 []) Source Public Required .false.), i: (Variable 2 i Local () () Default (Integer 4 []) Source Public Required .false.), last: (Variable 2 last Local () () Default (Integer 4 []) Source Public Required .false.), print_subrout: (Function (SymbolTable 3 {x: (Variable 3 x In () () Default (Integer 4 []) Source Public Required .false.)}) print_subrout [(Var 3 x)] [] [(Print () [(Var 3 x)] () ())] () Source Public Implementation () .false. .false. .false. .false.), x: (Variable 2 x Local () () Default (Integer 4 []) Source Public Required .false.)}) loop_unroll_small [] [(DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (Var 2 i) ())]) (= (Var 2 first) (IntegerConstant 1 (Integer 4 [])) ()) (= (Var 2 last) (IntegerConstant 4 (Integer 4 [])) ()) (DoLoop ((Var 2 i) (Var 2 first) (Var 2 last) ()) [(= (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) (IntegerBinOp (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) Add (Var 2 i) (Integer 4 []) ()) ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (SubroutineCall 2 print_subrout () [((Var 2 x))] ())]) (DoLoop ((Var 2 i) (IntegerConstant 1 (Integer 4 [])) (IntegerConstant 4 (Integer 4 [])) ()) [(= (Var 2 x) (ArrayItem (Var 2 array) [(() (Var 2 i) ())] (Integer 4 []) ()) ()) (If (IntegerCompare (Var 2 x) NotEq (IntegerBinOp (IntegerConstant 2 (Integer 4 [])) Mul (Var 2 i) (Integer 4 []) ()) (Logical 4 []) ()) [(ErrorStop ())] [])])])}) []) diff --git a/tests/tests.toml b/tests/tests.toml index ea1158ec3e..74f8274283 100644 --- a/tests/tests.toml +++ b/tests/tests.toml @@ -2206,6 +2206,10 @@ asr_implicit_typing = true filename = "implicit_typing2.f90" asr_implicit_typing = true +[[test]] +filename = "allow_implicit_interface.f90" +asr_implicit_interface = true + [[test]] filename = "dimension_attr2.f90" asr_implicit_typing = true @@ -2249,6 +2253,11 @@ 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 @@ -2259,3 +2268,33 @@ filename = "loop_test2.f" ast = true asr = true +[[test]] +filename = "continue_body_if_loop.f" +ast = true +asr = true + +[[test]] +filename = "parameter1.f90" +ast = true +asr = true + +[[test]] +filename = "variable1.f90" +asr_implicit_interface=true + +[[test]] +filename = "fixed_form_goto_select.f" +ast = true +asr = 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 diff --git a/tests/variable1.f90 b/tests/variable1.f90 new file mode 100644 index 0000000000..3235e0905c --- /dev/null +++ b/tests/variable1.f90 @@ -0,0 +1,5 @@ +subroutine variable01() +integer m,n +complex x(m), y(n), p1, p2, p3, p4 +call matveca(x,m,y,p1,p2,p3,p4) +end \ No newline at end of file