Progresso no Desenvolvimento do LFortran

This page documents what Fortran features are supported by LFortran. For each feature we list a short description, the filename with the test and current status for each parts of the compiler:

  • AST: The code can be parsed to AST (lfortran --show-ast test.f90)

  • ASR: The code can be transformed to ASR (lfortran --show-asr test.f90)

  • LLVM: LFortran can generate LLVM IR (lfortran --show-llvm test.f90)

  • BIN: The LLVM IR can compile to a binary

  • RUN: The binary runs without errors

If all are green it means the feature fully works and you can use it in your codes. Otherwise you can see what the status is of each feature.

This page is generated automatically using the Compiler Tester repository which contains all the Fortran tests and scripts to run LFortran to produce the tables below. We are looking for contributors to contribute more tests. Our goal is to have a comprehensive Fortran testsuite that can be used to test any Fortran compiler.

Testing the LFortran compiler version:

$ lfortran --version
LFortran version: 0.12.0-491-gaf48ff273
Platform: macOS
Default target: x86_64-apple-darwin20.3.0

Tópicos

Programas completos em que fazemos cálculo de algo interessante

Basic Numerics

Diretório: tests/programs/numerics

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

Implementação em Fortran puro de sin(x)

✅

✅

✅

✅

✅

t01_sin_implementation.f90

Módulos

Utilização básica

Diretório: tests/modules/basic

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

Basic modules

✅

✅

✅

✅

✅

t01.f90

Sub-rotinas e Funções dos Módulos

Directory: tests/modules/procedures

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

Module functions

✅

✅

✅

✅

✅

t01.f90

Module subroutines

✅

✅

✅

✅

✅

t02.f90

Nested subroutines

✅

✅

✅

✅

✅

t03.f90

Expressões

Arithmetic Operations

Directory: tests/expressions/arit

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

+,-,*,/,**

✅

✅

✅

✅

✅

basic_operations.f90

Inteiros

Directory: tests/expressions/integers

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

integers

✅

✅

✅

✅

✅

integer_kind.f90

relational operations

✅

✅

✅

✅

✅

t01_rel_operations.f90

logical operations

✅

✅

✅

✅

✅

t02_logical_operations.f90

Real Numbers

Directory: tests/expressions/reals

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

single/double reals

✅

✅

✅

✅

✅

real_kind.f90

defined operator

✅

❌

❌

❌

❌

t01_def_op.f90

Complex Numbers

Directory: tests/expressions/complex

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

número complexo de precisão simples/dupla

✅

✅

✅

✅

✅

complex_kind.f90

Cadeia de Caracteres

Diretório: tests/expressions/character

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

character

✅

✅

✅

✅

✅

t01_character.f90

concatenação de cadeias de caracteres

✅

✅

✅

✅

✅

t02_concat_operation.f90

Tipos Derivados

Diretório: tests/expressions/derived_type

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

basic derived types

✅

✅

✅

✅

✅

t01_derived_type.f90

Comandos

Comando Allocate

Diretório: tests/statements/allocate

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

comando allocate

✅

✅

✅

✅

✅

t01.f90

Comando Block

Diretório: tests/statements/block

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

comando block

✅

❌

❌

❌

❌

t01.f90

Comando Goto

Diretório: tests/statements/goto

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

computed go-to statement

✅

❌

❌

❌

❌

t01.f90

comando go-to

✅

❌

❌

❌

❌

t02.f90

Comando if

Diretório: tests/statements/if

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

Teste .false.

✅

✅

✅

✅

✅

if_01.f90

comando if na mesma linha

✅

✅

✅

✅

✅

if_02.f90

comando if ao longo de várias linhas

✅

✅

✅

✅

✅

if_03.f90

nested if statements

✅

✅

✅

✅

✅

if_04.f90

Comando While

Diretório: tests/statements/while

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

Simple while loops

✅

✅

✅

✅

✅

while_01.f90

exit / cycle em laços while

✅

✅

✅

✅

✅

while_02.f90

Open, Read, Write, Close Statement

Diretório: tests/statements/file_io

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

open/read/write/close

✅

✅

❌

❌

❌

t01.f90

Funções Intrínsecas

abs

Diretório: tests/intrinsic/abs

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

❌

❌

❌

❌

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

exp

Diretório: tests/intrinsic/exp

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

✅

✅

✅

✅

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

log

Diretório: tests/intrinsic/log

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

✅

✅

✅

✅

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

sqrt

Diretório: tests/intrinsic/sqrt

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

❌

❌

❌

❌

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

sin

Diretório: tests/intrinsic/sin

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

❌

❌

❌

❌

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

cos

Diretório: tests/intrinsic/cos

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

✅

✅

✅

✅

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

tan

Diretório: tests/intrinsic/tan

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

✅

✅

✅

✅

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

sinh

Diretório: tests/intrinsic/sinh

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

✅

✅

✅

✅

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

cosh

Diretório: tests/intrinsic/cosh

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

✅

✅

✅

✅

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

tanh

Diretório: tests/intrinsic/tanh

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

✅

✅

✅

✅

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

asin

Diretório: tests/intrinsic/asin

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

✅

✅

✅

✅

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

acos

Diretório: tests/intrinsic/acos

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

✅

✅

✅

✅

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

atan

Diretório: tests/intrinsic/atan

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

scalar single/double complex

✅

✅

✅

✅

✅

t02_scalar_complex.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

modulo

Diretório: tests/intrinsic/modulo

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

❌

❌

❌

❌

t01_scalar_real.f90

array 1D single/double real

✅

✅

❌

❌

❌

t03_array1d_real.f90

mod

Diretório: tests/intrinsic/mod

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

❌

❌

❌

❌

t01_scalar_real.f90

array 1D single/double real

✅

❌

❌

❌

❌

t03_array1d_real.f90

min

Diretório: tests/intrinsic/min

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

❌

❌

❌

t01_scalar_real.f90

max

Diretório: tests/intrinsic/max

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

❌

❌

❌

t01_scalar_real.f90

int

Diretório: tests/intrinsic/int

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

❌

❌

❌

❌

t01_scalar_real.f90

real

Diretório: tests/intrinsic/real

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

✅

✅

✅

✅

t01_scalar_real.f90

floor

Diretório: tests/intrinsic/floor

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

❌

❌

❌

❌

t01_scalar_real.f90

nint

Diretório: tests/intrinsic/nint

Descrição

AST

ASR

LLVM

BIN

RUN

Nome do ficheiro

scalar single/double real

✅

❌

❌

❌

❌

t01_scalar_real.f90